Fix for JDatabaseQuery union function

The current function creates an invalid SQL statement.