1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

Top 3rd value

Discussion in 'SQL - Questions and Answers' started by Mahesh RG, Jul 16, 2007.

  1. Mahesh RG New Member

    Hello can any buddy tel me can i write a query to get the top 3rd, 4th value from the table 'emp'?
  2. Unregistered Guest

    Hi,
    This is the query which will give top 3rd and 4th value.
    select *
    from(select * from Your_table order by somecoloum desc)
    where rownum<5
    Minus
    select *
    from( select * from Your_table order by somecoloum desc)
    where rownum<3 ;

    Bye
    Sheetal
  3. Unregistered Guest

    select top1 from (select distinct top3 from table name order by sal desc)
  4. Unregistered Guest

    SQL Qureies for retriew 3rd max salary:
    Select max(salary) from emp where salary not in (select top 2 salary from emp order by salary desc)

    Thanks & Regards
    Alagu....
  5. Unregistered Guest

    SELECT Min(qty) AS Expr1
    FROM (select top 3 qty from cashmemodetail order by qty desc)
  6. Ananthan Guest

    select salary from E1 where (4-1)=(select count(distinct(salary)) from E2 where E2.salary>E1.salary).

Share This Page