我有一个选择mysql的问题,表是这样的:
id_type | id_funz | state
10 26 1
10 28 1
11 26 1
我想选择id_type(with group by),他们(state_funz 26和28)在state = 1,实际上只有id_type = 10
为什么这不起作用?
SELECT *
FROM table
WHERE
(id_funz = 26 AND state = 1) and ((id_funz= 28 AND state = 1)
group by id_type
非常感谢你
答案 0 :(得分:0)
id_funz = 26
和id_funz = 28
不能同时发生。将您的代码更改为:
(id_funz = 26 AND state = 1) OR (id_funz= 28 AND state = 1)