当前位置:数据库 > MySQL >>

mysql sql 数据库多条件查询排序 在写一个sql语句的时候总是出错,没有找出错误所在

select * from account order by gscl_date where id = id&& com_lx= '其他有限责任公司' limit 0, 20 错误提示 #1064 - 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 'where id = id && com_lx= '其他有限责任公司' LIMIT 0, 30' at line 1
答案:select * from account  where id = id&& com_lx= '其他有限责任公司' limit 0, 20  order by gscl_date
其他:order by语句要放到查询结束的时候
还有,查询的时候能用&&吗?我一般都用的and &&换成and
select * from account  where id = id and com_lx= '其他有限责任公司' limit 0, 20 order by gscl_date 

上一个:mysql合并数据库
下一个:创建Mysql数据库后自动生成db.opt,请问可以删除吗?删除后有什么影响没?~

Oracle
MySQL
Access
SQLServer
DB2
Excel
SQLite
SYBASE
Postgres
如果你遇到数据库难题:
请访问www.zzzyk.com 试试
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,