Mysql 如果在';如果条件为';

Mysql 如果在';如果条件为';,mysql,Mysql,//该返回(1,2,3,5,8,9) //此返回b select if(5 in (select group_concat(column) from table where id=8),'a','b'); //此返回一个在这种情况下,您不需要使用group\u concat select if(5 in (5,4,6),'a','b'); 问题是什么?@juergend第二个select语句也应该返回'a'而不是'b' select if(5 in

//该
返回(1,2,3,5,8,9)

//此
返回b

select 
      if(5 in (select group_concat(column) from table where  id=8),'a','b');

//此
返回一个

在这种情况下,您不需要使用
group\u concat

select 
      if(5 in (5,4,6),'a','b');

问题是什么?@juergend第二个select语句也应该返回'a'而不是'b'
select 
      if(5 in (5,4,6),'a','b');
select if(5 in (select `column` from `table` where id=8),'a','b');