开发者

SQLite tuples equality comparison

开发者 https://www.devze.com 2023-02-22 01:45 出处:网络
With PostgreSQL and MySQL it is all right to do something like SELECT * FROM mytable WHERE (column1, column2) = (\'value1\', \'value2\'开发者_开发技巧);

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

精彩评论

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