I am trying to make a union of a few tables data into one query using. I am using Yii framework (v1.15). I have done it like this and this worked fine:
$command = Yii::app()->db->createCommand();
$command->select('something')->from('somewhere');
$command->union($sql);
This produces something like this:
SELECT SOMETHING FROM SOMEWHERE UNION (SELECT ....)
But union merges duplicate row values. I need to combine all of the data using UNION ALL
, but I can't find anything about how to do it in the
documentation.
Maybe some of you how can I do it using the yii database object? Thank you