select top 5 * from table

解决方案 »

  1.   

    <?
      $sql="select top 5 * from table";
    ?>
      

  2.   

    <?
      $sql="select top 5 from [table]";
    ?>
      

  3.   

    <?
      $sql="select top 5 字段 from table";
    ?>
      

  4.   

    什么数据库?
    MySQL  select * from table order by 排序 limit 0,5 //从0 开始到 5
      

  5.   

    select * from your_table order by 索引字段 limit 5
      

  6.   

    $sql="select top 5 * from table";
    or
    select * from your_table order by 索引字段 limit 5
      

  7.   

    我想采用$sql="select top 5 * from table";
    但我机子上怎么出现错误提示啊
      

  8.   

    拒我所知,在mysql里是没有select top的
    只有用limit 0,5
      

  9.   

    啊,MYSQL没有TOP关键词的用法?
      

  10.   

    对的我开始没看清楚问题:
    asp中访问access、sql server 都是用select top 5 * from tablename'指取头5条
    而php访问mysql就是 select * from tablename limit 0,5##指从0条开始取5条