select top 5 dep from table order by amount desc

解决方案 »

  1.   

    select *
    from tablename a
    where amount in (select top 5 amount from tablename where a.dpt = dpt)
      

  2.   

    select *
    from tablename tem
    where amount in (select top 5 amount from tablename where dpt =tem.dpt order by amount desc)
      

  3.   

    select * from 表名 tem where  item in (select top 5 item from 表名 where dpt=tem.dpt order by amount desc)
      

  4.   

    select  top 5 from table
      

  5.   

    select  top 5 from table
      

  6.   

    select top 5 * from tablename order by amount desc
      

  7.   

    select * from table a where  item in (select top 5 item from table where dpt=a.dpt order by amount desc)
      

  8.   

    select * from tablename a
    where amount in (select top 5 amount from tablename where a.dpt = dpt order by amount desc)
      

  9.   

    select * from tablename a
    where item in (select top 5 item from tablename where a.dpt = dpt order by amount desc)