Matching a value to multiple columns (in one statement) from a table using MySQL

后端 未结 9 1838
无人共我
无人共我 2021-02-08 21:29

I\'m working with a table in MySQL that contains the following columns:

id, january, february, march, april, etc

The data in the table looks li

9条回答
  •  无人共我
    2021-02-08 22:23

    You can use vectors in MySQL:

    select * from table where (january, february) = (1, 1)
    

    Beware of different server and client collations for text columns, possibly you'll need to specify collation explicitly then.

提交回复
热议问题