SQLite 元组相等性比较
对于 PostgreSQL 和 MySQL,可以做类似的事情
SELECT * FROM mytable WHERE (column1, column2) = ('value1', 'value2');
当我在 SQLite3 上尝试同样的事情时,它给了我一个令人筋疲力尽的错误消息:
Error: near ",": syntax error
从 SQLite 文档中我无法弄清楚它是否支持元组。有人能解释一下吗?
With PostgreSQL and MySQL it is all right to do something like
SELECT * FROM mytable WHERE (column1, column2) = ('value1', 'value2');
When I tried the same thing on SQLite3, it gave me an exhausting error message:
Error: near ",": syntax error
From the SQLite documentation I can't figure out whether it supports tuples or not. Can anyone shed some light on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
语法为
WHERE expr
,正如我们在expr
的语法图中所看到的,不支持后跟逗号的列 (expr)。
表达式:
The syntax is
WHERE expr
and as we can see in the syntax diagram forexpr
,a column (expr) followed by a comma isn't supported.
expr:
这样做:
SELECT * FROM mytable WHERE column1 = 'value1' AND column2 = 'value2'
Do like this:
SELECT * FROM mytable WHERE column1 = 'value1' AND column2 = 'value2'