SQL - How to select a row having a column with max value in Oracle
问题 date value 18/5/2010 40 18/5/2010 20 20/5/2010 60 18/5/2010 30 17/5/2010 10 16/5/2010 40 18/5/2010 60 18/5/2010 25 Output date value 18/5/2010 60 20/5/2010 60 I need to query for the row having max(value)(i.e. 60). So, here we get two rows. the date can be in any order Plz do not use rownum and subquery I need a dynamic query 回答1: I believe this is what you're looking for: select * from table where value = (select max(value) from table); 回答2: select * from (select * from table order by value