In yii we can write our custom or row query for complex queries here is an example of custom query with multiple table joins
$data = Yii::app()->db->createCommand()
->select('column1.column2,column3.name')
->from('table')
->join('table1','table.tableid=table1.id')
->join('table2','table.columnid=table2.id')
->join('table3','table3.columnid=table1.id')
->where('table3.userid=5')
->group('table2.id')
->queryAll();
0 Comment(s)