All rows with the max value : MAX « Aggregate Functions « Oracle PL / SQL






All rows with the max value

   

SQL>
SQL>
SQL> create table myTable
  2  as
  3  select rownum id, a.*
  4    from all_objects a
  5   where 1=0
  6  /

Table created.

SQL>
SQL>
SQL>
SQL> select *
  2  from myTable myTable1
  3  where last_ddl_time = (select max(last_ddl_time) from myTable myTable2 where myTable2.owner = myTable1.owner )
  4  /

no rows selected

SQL>
SQL> drop table myTable;

Table dropped.

   
    
    
  








Related examples in the same category

1.MAX: return the highest values in a column, ignore NULLs
2.Syntax: MAX ([DISTINCT]|[ALL] )
3.Use MAX with dates, it gives you the most recent dates
4.MAX with character data, retrieves the highest value alphabetically (that is, closest 'z').
5.Max with null value
6.Max - Min
7.Display the order number and total order price of the order(s) with the maximum total order price
8.max(total_price) - min(total_price)
9.Who have the max value