Home » SQL & PL/SQL » SQL & PL/SQL » Selecting * from a max(columnID) of a table
Selecting * from a max(columnID) of a table [message #1316] Fri, 19 April 2002 21:27 Go to next message
Raghu Raman
Messages: 4
Registered: February 2002
Junior Member
Hello,
I need to select * from a max(columneName) from TABLE. Now, I could use a sub query like "select * from (select max(columnName) from TABLE)"
The problem with this is that it doesnt work with MySQL.
How can I write a single query to do this??? (the other more complicated option is to use 2 queries which Id have to use as a last resort).
Re: Selecting * from a max(columnID) of a table [message #1321 is a reply to message #1316] Sat, 20 April 2002 22:26 Go to previous message
Todd Barry
Messages: 4819
Registered: August 2001
Senior Member
I don't know about MySQL, but in Oracle you would do:

select *
  from t
 where c = (select max(c) from t);
Previous Topic: pl/sql - equation
Next Topic: Oracle installation
Goto Forum:
  


Current Time: Sat Apr 27 06:31:07 CDT 2024