我如何在 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
请帮忙