This is the where clause I found when fixing a procedure one day...
FROM Rotation SR LEFT JOIN Break_Type BT ON BT.BT_ID = SR.BT_ID,
(select bandklocka, sp_id from Spot) S,
spot cg
where sr.rotationid = @CopyGroupRef
and sr.rotationid = cg.bandklocka
and s.bandklocka = sr.spotid
and sr.spotid = s.bandklocka
ORDER BY SR.STARTDATE
Now you may not know what a Bandklocka is, but I bet you can see what is off with its usage here.
No comments:
Post a Comment
Be nice... it's the only internet we have.