Subject Re: SQL ORDER BY problem
Author csswa
--- In ib-support@y..., Svein Erling Tysvær
<svein.erling.tysvaer@k...> wrote:
> Nice try Andrew, but you do not need any SP for this question.
>
> SELECT * FROM TableA
> WHERE C1 = 'X'
> AND (C2 = 'Y' OR NOT EXISTS(SELECT 1 FROM TableA B WHERE B.C1
= 'X' AND
> B.C2='Y'))
>

I'd rather suck a lemon while chewing on aluminium foil that try to
get my head around that! :-) A nice solution, SET!

Regards,
Andrew Ferguson
-- (did I say that out loud?)