user1594367
user1594367

Reputation: 157

yii framework, how to implement union sql

i am trying to do something like this on yii actionAdmin()

select * from car where carbrand = 'bmw' limit 1
union
select * from car where carbrand = 'mercedez'

i cannot find anything to do with union on CDbCriteria

Is there any other way?

Upvotes: 0

Views: 3719

Answers (1)

user1312885
user1312885

Reputation:

U can try to merge criteria with another one http://www.yiiframework.com/doc/api/1.1/CDbCriteria#mergeWith-detail or u can use DAO and CDbCommand http://www.yiiframework.com/doc/api/1.1/CDbCommand#union-detail.

Upvotes: 3

Related Questions