是否可以在Yii中的ActiveRecord中进行子查询?
我有这样的查询:
select * from table1
where table1.field1 in (select table2.field2 from table2)
我目前正在使用以下代码:
object1::model()->findAll(array('condition'=>'t.field1 in (select table2.field2 from table2)'))
[编辑]
我想知道是否有一种方法来构造子查询而不使用SQL,并且不使用连接.
有什么解决方案吗?
并提前感谢.