SELECT * FROM bg_qa where id in (select id from bg_qa where tenant_id=3 and package_id in(0) and status = 1 and category_id in (1,574)
union select belong from bg_qa where tenant_id=3 and package_id in(0) and status = 1 and category_id in (1,574))
上面的语句查询失败
但是单独查询里面的字语句没有问题:
select id from bg_qa where tenant_id=3 and package_id in(0) and status = 1 and category_id in (1,574)
union select belong from bg_qa where tenant_id=3 and package_id in(0) and status = 1 and category_id in (1,574)
SELECT * FROM bg_qa where id in (123,321,0)
下面的语句可以查询到,有大哥解释下为什么吗
SELECT * FROM bg_qa where id in (select id from (select id from bg_qa where tenant_id=3 and package_id in(0) and status = 1 and category_id in (1,574)
union select belong from bg_qa where tenant_id=3 and package_id in(0) and status = 1 and category_id in (1,574) )as abc)