Mysql
 sql >> Datenbank >  >> RDS >> Mysql

SELECT from subquery in Codeigniter Active Record

Ich habe es geschafft, die Abfrage zum Laufen zu bringen, indem ich den from eingefügt habe sub_query in die anfängliche select-Anweisung:

$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");