Skip to content
Advertisement

Combine two statements with LIMITS using UNION

Is there a way to combine these two statements into one without having duplicate entries?

My first, obvious attempt is not supported by SQLITE (Syntax error: Limit clause should come after UNION not before):

Advertisement

Answer

Use subqueries and perform the limit within them.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement