Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Last 3 orders from each customer - sql puzzle
Message
From
25/09/1999 15:52:28
 
 
To
25/09/1999 14:09:06
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00268263
Message ID:
00268987
Views:
21
Cindy,

Your right! It's a valid use of SQL. I guess it's just another example of how limited VFP's implementation of ANSI SQL is.

You could brake the query into two pieces:

SELECT TOP 3 orderid
FROM orders
ORDER BY orderdate DESC
INTO CURSOR top3

SELECT *
FROM orders INNER JOIN ordlines
ON orders.orderid = ordlines.orderid
WHERE orders.orderid IN (
SELECT orderid
FROM top3)

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform