Csaba Nagy <nagy(at)ecircle-ag(dot)com> writes:
> The only problem is that you can't use the order by/limit syntax inside
> the union queries I guess, cause the query you proposed is giving a
> syntax error.
Parentheses are your friend ;-)
regards, tom lane