开发者

SQLite tuples equality comparison

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?


The syntax is WHERE expr and as we can see in the syntax diagram for expr,
a column (expr) followed by a comma isn't supported.

expr:

SQLite tuples equality comparison


Do like this:

SELECT * FROM mytable WHERE column1 = 'value1' AND column2 = 'value2'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜