I have a table as follows :
tabl1 :
id name created_on
---- ------ ----------
1 red 2016
2 green 2017
3 blue 2018
and query as below
select max(id),
name,
created_on
from tabl1
Result :
id name created_on
--- ---- ----------
3 red 2016
Here, Iam getting the max id correctly but name and created_on values are not from the same row. How can I return the result like this :
id name created_on
--- ---- ----------
3 blue 2018