>Hi Sergey,
> That's an interesting idea, but it might not give a complete row. It could give some columns from one row and some columns from another row. I don't care which row it gives, but it has to be a complete row, that is, all the columns must come from a single row.
> Is there any other way to get around the GROUP BY constraint?
For what you're looking for, you really need to use two queries in sequence. The first query identifies the records of interest and the second extracts the data from them.
I don't know what your exact case is, but here's an example.
SELECT Customer_ID, MAX(Order_Date) AS MaxDate ;
FROM Orders ;
GROUP BY 1 ;
INTO CURSOR RecentOrders
SELECT RecentOrders.Customer_ID, Order_No, Order_Date ;
FROM Orders ;
JOIN RecentOrders ;
ON Orders.Customer_ID = RecentOrders.Customer_ID ;
AND Orders.Order_Date = RecentOrders.Order_Date ;
INTO CURSOR Result
Tamar