Unknown column 'rownum' in 'where clause'解决方案
来源:互联网 发布:vb颜色代码大全 编辑:程序博客网 时间:2024/04/29 19:19
Unknown column 'rownum' in 'where clause',当在嵌套的查询语句里面用到rownum的时候会遇到这个问题,比如:
SELECT * FROM (select t.id,t.name from USER_INFO t where t.status=0 order by t.EMP_ID desc) _queryForTop where rownum <=10;
这条sql语句查询的时候就会遇到Unknown column 'rownum' in 'where clause'这个错误。
看了下mysql官方的解释,发现在嵌套的查询语句中,当用到where的时候,数据的条数可能还没有被决定, rownum这是根本都还没出来。所以会报错。有遇到这个问题的兄弟们,只能改一改你们的sql语句咯。
mysql官方的链接如下:http://bugs.mysql.com/bug.php?id=38879
http://dev.mysql.com/doc/refman/4.1/en/problems-with-alias.html
原来的那段文字如下:
Standard SQL disallows references to column aliases in a WHERE
clause. This restriction is imposed because when the WHERE
clause is evaluated, the column value may not yet have been determined.
- Unknown column 'rownum' in 'where clause'解决方案
- Unknown column '安妮宝贝' in 'where clause'
- Unknown column '??????' in 'where clause'问题
- Unknown column 'xxx' in 'where clause'错误
- Unknown column 'ORGANIZATION_BANK' in 'where clause'
- 中文乱码 unknown column in 'where clause'
- Column not found: 1054 Unknown column 'tl10709' in 'where clause'
- 查询避免Unknown column ‘xxx’ in ‘where clause’
- 查询避免Unknown column ‘xxx’ in ‘where clause’
- c#Bug Unknown column “张三” in 'where clause'问题解决
- 查询避免Unknown column ‘xxx’ in ‘where clause’
- msql查询中报错 Unknown column '黄色水果' in 'where clause'
- JDBC出现 "Unknown column 'xxx' in 'where clause' "
- mybatis查询报错 Unknown column 'xxx' in 'where clause'
- TP 框架解决Unknown column 'XXX' in 'where clause' 问题
- mysql Column 'dbvalue' in where clause is ambiguous解决方案
- SQLSTATE[42S22]: Column not found: 1054 Unknown column 'tbl_contact' in 'where clause'.
- SQLSTATE[42S22]: Column not found: 1054 Unknown column 'staff_info.depart_id' in 'where clause'
- 重装mysql
- html的onload事件不触发问题
- iPhone控件自定义控件开发:重绘还是组合
- 多线程的原子操作和线程数据共享
- linux进程监控与自动重启实现
- Unknown column 'rownum' in 'where clause'解决方案
- dblink
- sip服务器kamailio的问题
- 选中某项
- 技术人员 应该有点基本的想法。。。AD。。。
- VC++6.0 MSDN下载地址
- Android开发者必须深入学习的10个应用开源项目
- android 64 bit ubuntu
- MYSQL面试题