plese check the query and let me knw what is incorrect in it

  • hi all

    here is my query i m trying to get the second highest id_num from my new_employes table

    please chk and let me knw what is wrong in it

    declare @id int

    set @id=select top 2 id_num from new_employes order by id_num desc

    select id_num from new_employes where id_num= min(@id)

    thx

    Anu

  • Please don't repost existing questions in new threads. It just wastes people's time and fragments replies

    No replies to this thread please. Direct replies to: http://www.sqlservercentral.com/Forums/Topic715000-338-1.aspx

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 2 posts - 1 through 1 (of 1 total)

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