yii framework, how to implement union sql

主宰稳场 提交于 2020-01-07 02:27:21

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/12127908/yii-framework-how-to-implement-union-sql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!