Ordering multiple SELECT statements in a UNION


/ Published in: SQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. (SELECT a FROM t1 WHERE a=10 AND B=1)
  2. UNION
  3. (SELECT a FROM t2 WHERE a=11 AND B=2)
  4. ORDER BY a LIMIT 10;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.