Results 1 to 6 of 6

Thread: How we can find the nth higest number in MSSQL?

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Answers
    1

    How we can find the nth higest number in MSSQL?

    How we can find the nth higest number in MSSQL?


  2. #2
    Moderator
    Join Date
    Jun 2007
    Answers
    2,074

    Re: How we can find the nth higest number in MSSQL?

    What do you mean by nth higest number . Are you trying to find out nth heighest value from a table . Like 10th heighest salary or 5th elder person. Please specify your requirment clearly.


  3. #3
    Junior Member
    Join Date
    Jan 2008
    Answers
    1

    Re: How we can find the nth higest number in MSSQL?

    To fine the N-th highest number you can use the subquery and substitute with the desired number:

    SELECT MIN(ColumnName) FROM TableName WHERE ColumnName IN (SELECT TOP ColumnName FROM TableName ORDER BY ColumnName DESC)


  4. #4
    Junior Member
    Join Date
    Feb 2008
    Answers
    4

    Re: How we can find the nth higest number in MSSQL?

    select max(coloumn-name) from Table-name

    try out this it will give the n-th highest number


  5. #5
    Junior Member
    Join Date
    Sep 2007
    Answers
    1

    Thumbs up Re: How we can find the nth higest number in MSSQL?

    select * from emp e1 where n=(select count(Distinct e2.sal) from emp e2 where e1.sal<=e2.sal);


    in "n" place u can give any no 0k.... it is working...

    ALL THE BEST


  6. #6
    Junior Member
    Join Date
    Feb 2008
    Answers
    1

    Re: How we can find the nth higest number in MSSQL?

    Hi, can any one tell me is it possible to install informatica tool in linux operating systems.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact