How to select a column with order by for the same column,
For eg :- If a table Employee having 4 columns Empno, Empname, Sal, DOJ and i want to get the top 50 employees based on the latest DOJ and first column as DOJ in my results.
if i use the below query
select top 50 DOJ ,* from Employee with (NOLOCK) order by DOJ desc
It throws Ambiguous column name.