Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Correlated subquery
Message
From
19/03/2021 12:53:38
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01679045
Message ID:
01679117
Views:
56
>>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.

Off

There is no place like [::1]
Previous
Reply
Map
View

Click here to load this message in the networking platform