We're going to be adding some advertisements to the forums! If you notice any weirdness around this or spot bad/inappropriate ads, please make a thread in the bugs forum.

Sybase SQL subquery help

DeebaserDeebaser on my way to work in a suit and a tieAhhhh...come on fucking guyRegistered User regular
edited April 2011 in Help / Advice Forum
My code is broken...
I'm trying to pull in the a snapshot as of 1/1/2011, but my subquery isn't being kind. Could some kind and magnificient bastard please point out the obvious and glaring error in my script?

and sr.THING_dt = (SELECT MAX(sr2.THING_dt) from ere..sale_THING sr2
where sr2.THING_class = sr.THING_class and sr.THING_id = sr2.THING_id
and sr2.THING_dt <= '1/1/2011')

EDIT: Solved. The failure wasn't in the subquery, per se. There were additional constraints outside of the subquery that needed to be removed from my initial select.

Deebaser on
Sign In or Register to comment.