Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> SQL Statement Question

SQL Statement Question

From: Michael G. Schneider <mgs_at_mgs-software.de>
Date: Fri, 26 Jan 2001 08:49:50 +0100
Message-ID: <94r9o6$ee9$01$1@news.t-online.com>

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US