CodePudding user response:
Thinking:Select * from
(select *, 0 as g from table
Where classification=XXX
Limit of 5
Union all
Select *, 1 as g from table
Where classification=yyy
Limit 5) a
The order by g
Limit of 5
CodePudding user response:
Thinking: