Fix union() query

Since we remove union clause  from select, we have to add union to `type` that it can work.

And a union type should not begin with `UNION (`