このクエリを codeigniter で変換する方法
select COUNT(*)
from Retailers
where ID not In (select RetailerID from RetailerGroups)
私はこれを試しました
$this->db->where_not_in('ID',$this->db->query('select RetailerID from
RetailerGroups'));
$query = $this->db->get('Retailers');
しかし、それは印刷します
Error Number: 42000
[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near ')'.
SELECT * FROM Retailers WHERE ID NOT IN ()
Filename: D:\Published\faber\core\database\DB_driver.php
Line Number: 330
助けてください