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

Home -> Community -> Usenet -> comp.databases.oracle -> tricky SQL question!

tricky SQL question!

From: JZ <ibm_97_at_yahoo.com>
Date: 5 Feb 2004 14:09:00 -0800
Message-ID: <10bc841c.0402051409.6e8ba3a8@posting.google.com>

Oracle 9iR2

I have a table:

SQL> select * from test;

A                            B          C
------------------- ---------- ----------
01/01/2004 10:00:00          1          1
01/01/2004 11:00:00          1          2
01/01/2004 11:00:00          2          3
01/01/2004 13:00:00          2          4
01/01/2004 12:00:00          2          5

For every different B value, I want to see the max A value and the corresponding C value. In the above example, the result shoud be:

A                      B     C
---------------------- ---- ---
01/01/2004 11:00:00    1     2
01/01/2004 13:00:00    2     4


How can I do this in SQL (no PL/SQL or SQL block)?

Thanks a lot! Received on Thu Feb 05 2004 - 16:09:00 CST

Original text of this message

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