Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to achieve a complex SQL
Message
From
24/07/2006 11:43:48
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01139004
Message ID:
01139218
Views:
9
>You can get the same result using correlated subquery
>SELECT menu.* FROM menu  ;
>	JOIN MenuOptions mo ON mo.NoMenu = menu.NoMenu AND mo.Enabled ;
>UNION ;
>SELECT menu.* FROM menu  ;
>	JOIN MenuPriviledge mp ON mp.NoMenu = menu.NoMenu AND mp.notype = lnNotype ;	
>	WHERE NOT EXISTS ( SELECT * FROM MenuOptions mo WHERE mo.NoMenu = menu.NoMenu)
>
Actually, this was my initial approach. But, I wasn't sure exactly how to make reference to Menu from the NOT EXISTS syntax.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform