今天写新闻管理模块,需要在页面显示最近5条新闻!
SQL语句如下:
String sql="select top 10 * from news where type='主页' order by news_id DESC ";
ResultSet rs= newsBean.executeQuery(sql);
测试的时候发现出错!ERROR 1064 (42000): 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 'from news where type='主页' order by news_id DESC
select top10 * from news wher' at line 1
请问到底是什么错误啊!!我用的是JSP+MYSQL+TOMCAT5.0 !!!!!!
SQL语句如下:
String sql="select top 10 * from news where type='主页' order by news_id DESC ";
ResultSet rs= newsBean.executeQuery(sql);
测试的时候发现出错!ERROR 1064 (42000): 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 'from news where type='主页' order by news_id DESC
select top10 * from news wher' at line 1
请问到底是什么错误啊!!我用的是JSP+MYSQL+TOMCAT5.0 !!!!!!
String sql="select * from news where type='主页' order by news_id DESC limit 10";