select top 5 * from table

解决方案 »

  1.   

    你最好排序一下,才能保证每次取的记录都一样
    select top 5 * from tablename order by col1 --col1 是具有唯一的列.
      

  2.   

    select top 5 * from table
      

  3.   

    天!晕!不会用top 吗?多看看SQL Server的联机帮助行不行?语句不熟,没关系,要多看!
    up up up up up
      

  4.   

    沒有SQL SERVER ,想學SQL SERVER.我暈
      

  5.   

    用SQL语句,不一定非要SQL Server啊~~~~他妈的,被人骂来骂去!!!
      

  6.   

    一般会找符合条件的记录吧!说说具体情况?什么时候在找到了所有符合条件的记录后还需要其中的5-10条记录?用having?
      

  7.   

    select top 5 * from 表
      

  8.   

    select top 5 * from 表
      

  9.   

    select top 5 from 表名 order by cool
      

  10.   

    select top 5 ... into #temp from ... order by id ascselect top 5 ... from #temp  order by id desc