Sort Order - Include Null al last

  • Anirban Paul (6/25/2008)


    Cheers to Steve.........:)

    I believe u are not going to deduct points for posting here 😉

    Now that's an idea...... 😎

    Semper in excretia, suus solum profundum variat

  • The given answer here is wrong which is not displaying the dateofleaving in ascending order.

    I think the correct answer is,

    select * from employees

    order by dateofleaving desc,empname asc

  • Just because I a bit of a newbie with SQL in general. I created the table and poplulated. Verified I had the right value and in SQL Server 2005 the statment 'SELECT EmpName, DateOfLeaving from #Employees ORDER BY DateOfLeaving DESC, EmpName ASC' got the correct answer.

    I did not try the supposed solution.

    Thanks.

  • Hi All

    I have tested the query by creating the table.

    Select EmpName, DateOfLeaving from Employees order by DateOfLeaving desc, EmpName asc

    Only the above statement will return the required output.

    3rd option is the correct , not the 2nd option.

    Balachandra Srinevasalu

Viewing 4 posts - 136 through 138 (of 138 total)

You must be logged in to reply to this topic. Login to reply