yii框架,如何实现union sql [英] yii framework, how to implement union sql

查看:26
本文介绍了yii框架,如何实现union sql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 yii actionAdmin() 上做这样的事情

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'

我在 CDbCriteria 上找不到任何与 union 有关的内容

i cannot find anything to do with union on CDbCriteria

还有什么办法吗?

推荐答案

您可以尝试将条件与另一个条件合并http://www.yiiframework.com/doc/api/1.1/CDbCriteria#mergeWith-detail或者你可以使用 DAO 和 CDbCommand http://www.yiiframework.com/doc/api/1.1/CDbCommand#union-detail.

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.

这篇关于yii框架,如何实现union sql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆