I have table:
tasks_whatwhom | CREATE TABLE tasks_whatwhom (
id int(3) NOT NULL AUTO_INCREMENT,
name varchar(150) NOT NULL,
message varchar(255) NOT NULL,
filial_list text,
client_list text,
PRIMARY KEY (id),
UNIQUE KEY name (`name`)
) ENGINE=Aria AUTO_INCREMENT=53 DEFAULT CHARSET=utf8 PAGE_CHECKSUM=1
Field filial_list
looks like '12,14'
.
There is another table filials
which contains addition information about filials.
SQL statement:
select * from filials where id IN(14,12) and status=1;
works as expect but below - returns zero. I don't understand why?
select * from filials where id IN(select filial_list from tasks_whatwhom) and status=1;