Greatest function in sql
Suppose a.last_update_date= 10/1/2015, a.last_updated_by=1
b.last_update_date= 10/3/2015, b.last_updated_by=3
c.last_update_date= 10/2/2015, c.last_updated_by=2
d.last_update_date= 10/4/2015, d.last_updated_by=4
Select greatest(a.last_update_date,b.last_update_date,c.last_update_date,d.last_update_date) from a,b,c,d;
o/p: 10/4/2015
How do i get the last_updated_by of the above greatest(a.last_update_date,b.last_update_date,c.last_update_date,d.last_update_date)???
i.e 2???