本文介绍了带WHERE子句的SQL LIMIT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在WHERE子句中使用LIMIT x? 如果是,怎么办?
Is it possible to use LIMIT x with the WHERE clause? If so, how?
我正在尝试这样做:
select * from myVIew LIMIT 10 where type=3;
但是我收到以下错误:
ERROR: syntax error at or near "where"
LINE 2: where type=3;
^
********** Error **********
ERROR: syntax error at or near "where"
SQL state: 42601
Character: 44
推荐答案
select * from myVIew where type=3 LIMIT 10;
Limit
应该在<$ c $之后c> where子句。
语法:
SELECT column_name(s)
FROM table_name
[WHERE]
LIMIT number;
这篇关于带WHERE子句的SQL LIMIT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!