有一個解決我的sql查詢的stackoverflow問題,但是我似乎無法做到這一點CodeIgnighter。ActiveRecord - 只有在沒有其他表時纔會得到結果
到目前爲止,我想出了在SO
$this->db->select('shop_coupons_assoc.*');
$this->db->select('shop_products.*');
$this->db->where('shop_products.id IS NULL');
$this->db->join('shop_coupons_assoc', 'shop_coupons_assoc.product_id = shop_products.id', 'left');
文章,這似乎是在SQL我嘗試做
更新 我的問題:我怎麼會寫在Codeignighter的SQL(主動記錄格式)
- 上述代碼似乎沒有執行
考試我需要什麼。只是不能找到codeignighter文檔
SQL - find records from one table which don't exist in another
How to select all records from one table that do not exist in another table?
那又有什麼問題呢? ;) – bonCodigo