I have example query
select id from clients where email like '%a%'
union
select id from clients where email like '%b%'
which works fine, but i need to add limits like
select id from clients where email like '%a%' limit 5
union
select id from clients where email like '%b%' limit 5
but this breaks with
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'union
select id from clients where email like '%b%' limit 5' at line 2
I made some tries and surprisingly
select id from clients where email like '%a%' limit 5
union
select id from clients where email like '%b%'
works fine
I'm using oracle mysql 8. Any ideas what I do wrong ?