发生数据库错误错误号:42000/102 codeignitier

时间:2016-12-16 09:08:57

标签: sql codeigniter

您好Codeignitier专家我需要帮助我有错误

<h1>A Database Error Occurred</h1>
  <p>Error Number: 42000/102</p><p>[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near 'c'.</p><p>select a.norm, b.nama as pasien, b.alamat, c.tanggal, c.tanggal1, f.jumlah, f.biaya from TTKunjungan a inner join TMPasien b on A.norm = b.norm inner join TTKunjunganDetail c on A.Kode = c.kodekunjungan inner join TMTrfTindakan d on c.kodetindakan = d.Kode inner join TMTrfLayanan e on d.kodelayanan = e.Kode left join (select kodett, sum(jumlah) as jumlah, sum(biaya) as biaya from TTKunjunganDetail where kodett is not null group by kodett) f on  c.Kode = F.kodett Where e.kodeklasifikasi = 2 and c.tanggal1 is null and c.kodett is null c.kodetindakan = '2161000011610000316100001'</p><p>Filename: D:/andi/xampp/htdocs/Simrsgum/system/database/DB_driver.php</p><p>Line Number: 664</p></div

这是我的sql命令

public function get_by_id1($Kode)
    {
        $tSQL = "select a.norm, b.nama as pasien, b.alamat, c.tanggal, c.tanggal1, f.jumlah, f.biaya from TTKunjungan a inner join TMPasien b on A.norm = b.norm inner join TTKunjunganDetail c on A.Kode = c.kodekunjungan inner join TMTrfTindakan d on c.kodetindakan = d.Kode inner join TMTrfLayanan e on d.kodelayanan = e.Kode left join (select kodett, sum(jumlah) as jumlah, sum(biaya) as biaya from TTKunjunganDetail where kodett is not null group by kodett) f on  c.Kode = F.kodett Where e.kodeklasifikasi = 2 and c.tanggal1 is null and c.kodett is null c.kodetindakan = '{$Kode}'";
        $list = $this->db->query($tSQL);
        $query = $this->db->get();
        return $query->num_rows();
}

你可以帮助我显示我的sintax错误的位置....

0 个答案:

没有答案