我要返回MYSQL 5.0中最后5条记录,SQL语句这样写:SELECT *,(SELECT count(*) AS n from book_inf) FROM book_inf where limit n-5,5
。但是出错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit n-5,5' at line 1 。我用的asp.net 2.0,请问怎么样才能达到我的要求。谢谢了!
。但是出错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'limit n-5,5' at line 1 。我用的asp.net 2.0,请问怎么样才能达到我的要求。谢谢了!
解决方案 »
- Windows 2003 mysql 执行备份命令后 没有数据
- txt文件导入到数据库问题
- MySQL中有没有限制返回的结果的关键字
- 一条查询操作,望高手指教
- 如何解决类似引用多个外键办法?--初学和高手都请进。。。。。。
- 数据库设计,我们的一个作业,帮帮忙
- MySQL 多表查询(求解)! 有<<耐心>>的高手请进!
- Error: Can't connect to MySQL server on 'localhost' (10057)
- mysql不支持top语句, 怎么实现类似功能?在线等。。。
- 请教:通过data文件夹恢复mysql数据库
- VB操作mysql数据库日制问题
- Select * from table2 where id In (Select id from table1 where catid < 25)
SELECT @rownum:=@rownum+1 rownum, t.*FROM (SELECT @rownum:=0) r, book_inf t order by rownum desc
LIMIT 0,5;