Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> SQL Statement Question
Suppose there is a Customer table containing
custPk (primary key)
custName (name)
and a Order table containing
ordPk (primary key)
ordCustomer (reference to Customer)
ordAmount (amount)
Now I would like to select all Customers with their highest order. So there should be exactly one row for each customer. And if that customer has orders, only the highest one should be taken.
How would I do this in SQL?
Michael G. Schneider
mailto:mgs_at_mgs-software.de
Received on Fri Jan 26 2001 - 01:49:50 CST