Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP8 GROUP BY Restriction
Message
 
 
To
29/05/2003 09:54:59
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00793077
Message ID:
00793913
Views:
30
Chaim,

As I said, you need one extra select to add RECNO() as a field to a cursor as shown below.
SELECT *, RECNO() AS nRecNo ;
   FROM Orders ;
   INTO CURSOR OrdersRecno
SELECT Customer_ID, MAX(nRecno) AS nRecNo ;
   FROM OrdersRecno ;
   GROUP BY 1 ;
   INTO CURSOR RecentOrders
SELECT RecentOrders.Customer_ID, Order_No, Order_Date ;
   FROM OrdersRecno ;
   JOIN RecentOrders ;
       ON OrdersRecno.Customer_ID = RecentOrders.Customer_ID ;
           AND OrdersRecno.nRecno = RecentOrders.nRecno ;
   INTO CURSOR Result
<snip>
> Sergey, I tried your suggestion (see below) but I can't figure out how to do a join based on a row number:
<snip>>
>Any other ideas? Is there some way to use the RECNO as a pointer to the desired row?
>
>Thanks, Chaim
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform