你能告诉我如何实现这个sql查询吗:
select * from products where (category, category2, category3) in (2, 138, 136, 125)
错误:
#1241 - Operand should contain 3 column(s)
最佳答案
只需像这样在 where 子句中写入所有列:
SELECT *
FROM products
WHERE
category IN (2, 138, 136, 125) OR
category2 IN (2, 138, 136, 125) OR
category3 IN (2, 138, 136, 125)
关于mysql - “in” 语句中的多个列 (mysql),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40889351/