Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL TOP in Query
Message
 
 
To
17/02/2009 02:37:17
Walter Meester
HoogkarspelNetherlands
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01382151
Message ID:
01382366
Views:
40
>>Frank, unless there can be multiple cInvoiceNo for the same iSaleId, how about
>>
SELECT TOP 2 c_Test.*,val(cInvoiceNo) as iord;
>>	FROM c_Test ;
>>	ORDER BY iord desc
>
>Yeah, I was wondering as well why a subquery was used. I wonder why this was not noticed by anyone else in this thread. Then I even saw subqueries within subqueries for such a simple problem. Err.... ???

You're right, seems like we don't need derived table at all.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform