I have a table like this:
ID  DATE        TableName  
X   29-Jan-12   A  
X   29-Feb-12   B  
X   29-Jan-12   C  
Y   18-Nov-12   A  
Z   18-Nov-14   C  
X   17-Nov-13   D  
Z   14-May-12   A  
Y   18-Nov-13   D  
I want to fetch unique ID with MaxDate so that output should be like this-
ID  DATE    TableName  
Z   18-Nov-14   C  
Y   18-Nov-13   D  
X   17-Nov-13   D 
I am using select ID, MAX(DATE), TableName from table but that is not giving me the desired output.
 
     
    