select * from table_a where field_a = 1 LIMIT 0, 3;
select * from table_a where field_a = 2 LIMIT 0, 3;
select * from table_a where field_a = 3 LIMIT 0, 3;
如何合并以上3个SQL查询为1个查询?
sql
select * from table_a where field_a = 1 LIMIT 0, 3 union select * from table_a where field_a = 2 LIMIT 0, 3 union select * from table_a where field_a = 3 LIMIT 0, 3;
SELECT * FROM table_a WHERE field_a IN (1, 2, 3)