且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从Codeigniter活动记录中的子查询中选择

更新时间:2023-01-24 15:03:53

我设法通过将 from 子查询放入初始选择语句中来使查询工作:

I managed to get the query to work by putting the from sub_query into the initial select statement :

$this->db->select("*, 
  (select image_path from image where image_table = 'model' and image_table_id = model_id
  group by image_table_id limit 1) as ModelImg FROM 
  (SELECT * FROM $view where offer_table = 'derivative' order by offer_order) x");