>>I can express
>>
>>select * from MyTable outside
>> where exists
>> ( select 1 from DiscountMaster inside where inside.active = 'N')
>>
>>
>>??
>>EXIST () is just EMPTY SET or NOT EMPTY SET. There is nothing said about correlation.
>>
>
>OK, point taken, so I'll paraphrase...I'm hard-pressed to think of any practical example where the subquery with an EXISTS will not be correlated. Correct, you can do that and it will execute, but beyond that, not sure anyone would write that :)
At least it is a way to do an operation if a certain dataset exists or not.
For example if the data for the sub query is changed on something and I guess this query will run once and that might be simpler then bound it into a join. Maybe.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]