Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Complicated Select
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01060659
Message ID:
01060763
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
>>Do select on FORCED and if it returns 0 record, run your regular select.
>>
>
>Is there a way to do this logic in one select?

I guess
SELECT * FROM mytable ;
  WHERE < Forced Condition > ;
UNION ALL ;
SELECT * FROM mytable ;
  WHERE < Other Condition >
   AND NOT EXISTS (SELECT * FROM mytable ;
  WHERE < Forced Condition > )
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform