</pre><p><pre name="code" class="php"> $schoolList = Yii::app()->db->createCommand()
->select("*,t.name as attr_name")
->from("school.un_school_top_attr t")
->leftJoin("un_school_attr dt", "dt.countries_type = t.id")
->where("dt.countries_type = {$countries_type}")
->queryAll();
第二种: