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:
Do like this:
SELECT * FROM mytable WHERE column1 = 'value1' AND column2 = 'value2'
精彩评论