Select top 5 * From yh order by id desc在mysql  数据库中不能运行?

解决方案 »

  1.   

    Select * From yh order by id desc limit 5
      

  2.   

    MySQL 中是 limitselect * from yh order by id desc limit 5可以参考一下手册中的语法。
    MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html
      

  3.   

    这是SQLSERVER的写法。
    Select   * From yh order by id desc
    limit 5
      

  4.   

    楼上都正确,昨天我才问到类似的问题:查询ID为主键的表A第31到40条记录
    语句为:select ID from A limit 30,10;
    或者为:select ID from A limit 10 offset 30;
      

  5.   

    SQL 规范2008里头会有统一要求,不远的将来有望统一。
      

  6.   

    将来标准的语法是:
    SELECT ... FROM ... WHERE ... ORDER BY ... FETCH FIRST n ROWS ONLY
      

  7.   


    这个不是db2的语法吗?难道要向db2靠拢?还是IBM出美元了?。行贿?