I'am using the "GROUP_CONCAT" function with the "NOT IN" statement in my mysql query. But for unknown reason, it doesn't return the correct values:
Here is my query not working:
select firstname, lastname
from t_user
where (status_Id NOT IN(Select GROUP_CONCAT(id) from t_status where code = 'ACT'
or code = 'WACT'))
Returns 46 rows
Here is my query working:
select firstname, lastname
from t_user
where (status_Id NOT IN(1,4))
Returns 397 rows
The results of the of the GROUP_CONCAT subquery
(Select GROUP_CONCAT(id) from t_status where code = 'ACT' or code = 'WACT') = 1,4.
It seems that the query take only care of the first item return by the GROUP_CONCAT subquery.
So I don't understand what's going on and why I do not have the same results in both cases.
Thanks in advance Gael