详细解决方案
sql语句找不着这个异常啊
热度:6618 发布时间:2013-02-25 21:18:27.0
select top 3 student.StudentName as studentname,student.StudentId as studentid,student.MatriNo as matrino,speciality.SpecialityName as specialityname from student,speciality where student.SpecialityId=speciality.SpecialityId and student.SpecialityId=? and student.StudentName like ? order by StudentId desc
我用的是mysql数据库,运行到这里时老师提示错误:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 '3 student.StudentName as studentname,student.StudentId as studentid,student.Matr' at line 1
我是比较菜的,这错误困扰多时,请各位高手帮忙看看啦!
------解决方案--------------------------------------------------------
在mysql里用limit限制记录数
SELECT * FROM 表 LIMIT 3
------解决方案--------------------------------------------------------
在mysql的语法中是没有top的。top是在sqlServer中用的。
------解决方案--------------------------------------------------------
top是sql中的 如果是mysql 使用limit 0,3从0开始取三个
------解决方案--------------------------------------------------------
mysql简单分页:
select * from tableName order by id limit start,end;
其中start和end分别是行的索引
相关解决方案
- tomcat启动后出现The requested resource is not available.异常
- WEB开发 Unknown character set: 'utf8mb4' 异常
- mybatis 地图per中的sql 语句 动态判断是否oracle或者mysql
- java 预编译 能100%的解决 sql 注入的有关问题么
- 为啥调试出来的sql语句在数据库可以执行,在程序中执行完报错:ORA-00933: SQL 命令未正确结束
- You have an error in your SQL syntax解决思路
- JSTL <SQL>使用JNDI 問題解决办法
- iReport中使用JavaBean作为Table的数据源:The supplied java.sql.Connection object is nul解决方法
- 剔除的时候为什么总是java.sql.SQLException: ORA-00904: "UPDATEROLE_NAME" 标识符无效
- 只想让log4j文件 打出 异常 和sql 该如何配置
- CXF WebSphere 异常,望一二
- myeclipse 如何导入字体 啊
- 出错:java.sql.SQLException: 关闭的连接,大神帮忙看下
- json传输日期(2014-10-24)出错at java.sql.Date.getHours
- 仔细看了下sql语句还是报You have an error in your SQL syntax; 这个异常
- sql server 2012分页查询解决方案
- 关于java.sql.SQLException: 关闭的 Resultset: next错误有关问题
- jsp 异常 java.lang.ClassNotFoundException: org.apache.lucene.store.Directory 求原因
- tomcat Root目录 文件访问 HTTP Status 404 异常
- java sql web查询如何实现,给个思路
- ibatis java.sql.SQLException: 列名无效,该如何处理
- 求救 求救 JPS 开发 连接编译出现 异常 org.apache.jasper.JasperException: Unable to load class for JSP
- "java.sql.SQLException: ORA-03115: 不支持的网络数据类型或表示法"
- java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] 找不到文件 '(未知的)'。该如何解决
- 为什么编辑器提交表单,内容是oracle.sql.CLOB@ebd4ee,该怎么处理
- java.lang.NoClassDefFoundError: javax/sql/rowset/Joinable,该如何解决
- 网上书店 java+sql 2000,该如何处理
- weblogic 报requested URL string is null 异常
- ibatis动态配置信息-java.sql.SQLException: ORA-00933: SQL command not properly ended
- java.sql.SQLException: Network error IOException: Address already in use: connect解决方法