求一条查询语句解决方案
求一条查询语句PHP code两张表表A:product_iduser_id112212313413表B:product_idowner_id212312413513假设
求一条查询语句
PHP code两张表表A:product_id user_id1 122 123 134 13表B:product_id owner_id2 123 124 135 13假设我要根据user_id=owner_id=12 来查询product_id, 最后要得到的结果是1,2,3,怎么做?
[解决办法]select product_id from A where user_id=12
union
select product_id from B where owner_id=12