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

Home -> Community -> Usenet -> c.d.o.server -> max values

max values

From: <hpcheong_at_ncs.com.sg>
Date: Sat, 09 Jan 1999 04:15:42 GMT
Message-ID: <776l5d$fd8$1@nnrp1.dejanews.com>


hi all,

i like to ask about the following.

SQL> select * from temp;

CODE       NAME       ADDRESS
----------       ----------       ---------
12             jane          abc
15             peter         qwe
10             pat            poi
9               leo            lkj
8               eve          dfg

when i do a <select max(code) from temp;>, the result is

MAX(CODE)



9

instead of 15. what is the correct syntax in order to have 15 to be the expected result.

secondly, with the max values got from code, i would want to have the name's result as well which should be peter. what is the syntax? when i do this <select name, code from temp where name = max(name);>, error is ORA-00934: group function is not allowed here. any idea?

could it because oracle 7.2 do not allow such function?

pls help..
thanks in advance!
evelyn.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Fri Jan 08 1999 - 22:15:42 CST

Original text of this message

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