Union applied settings to the set

The union applied settings like group/having/order to the set instead of the first select.
Currently the query object doesn't support set settings. Use the string manipulation instead.