Order By Clause

  • Fin3125

    Old Hand

    Points: 374

    I agree.. Never would have put the Order by in the sub because I don't see the reason too. So I would have never learn it would fail until now

  • Britt Cluff

    SSCertifiable

    Points: 5083

    Really had to think through this one. Thanks for a tough question of the day.

    http://brittcluff.blogspot.com/

  • jitesh-430609

    Grasshopper

    Points: 17

    3rd will also fail since ambiguous column with order by.

  • Nandhini Ramanujam

    SSC-Addicted

    Points: 497

    Query 3 would fail because both tables contain employee id column but, alias name of employee id have not been used in order by clause. Please check for the Query 3 and revert back.

  • cengland0

    SSCertifiable

    Points: 6102

    Nandhini Ramanujam (5/31/2012)


    Query 3 would fail because both tables contain employee id column but, alias name of employee id have not been used in order by clause. Please check for the Query 3 and revert back.

    Query 3 does not fail. if there is more than one EmployeeID column, the ORDER BY clause uses the one that is in the select statement. There is only one in the select statement so the query executes just fine.

  • kalyani.k478

    Default port

    Points: 1400

    very nicw question..i got it wrong though:-D

Viewing 6 posts - 46 through 51 (of 51 total)

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