gpt4 book ai didi

mysql - 错误代码: 1064 | Delimiter

转载 作者:行者123 更新时间:2023-11-29 22:27:51 26 4
gpt4 key购买 nike

分隔符$$

ALTER ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_t_buku_bank` AS 
SELECT
`b`.`id` AS `id`,
`b`.`no_bku` AS `no_bku`,
`b`.`tanggal` AS `tanggal`,
`b`.`tanggal_bayar` AS `tanggal_bayar`,
`b`.`id_transaksi_bank` AS `id_transaksi_bank`,
`b`.`no_bukti` AS `no_bukti`,
`b`.`jumlah` AS `jumlah`,
`b`.`id_akun_pendapatan` AS `id_akun_pendapatan`,
`ap`.`kode` AS `pendapatan_kode`,
`m`.`jenis` AS `jenis`,
`m`.`nama` AS `transaksi`,
`ap`.`nama` AS `pendapatan`,
IF((`m`.`jenis` = 'm'),`b`.`jumlah`,0) AS `masuk`,
IF((`m`.`jenis` = 'k'),`b`.`jumlah`,0) AS `keluar`
FROM ((`t_buku_bank` `b`
JOIN `t_master_transaksi_bank` `m`
ON ((`m`.`id` = `b`.`id_transaksi_bank`)))
LEFT JOIN `akun_pendapatan` `ap`
ON ((`ap`.`id` = `b`.`id_akun_pendapatan`)))$$

IF((`b`.`id_transaksi_bank` = '11'),`b`.`jumlah`,0) AS `m11`,
IF((`b`.`id_transaksi_bank` = '12'),`b`.`jumlah`,0) AS `m12`,
IF((`b`.`id_transaksi_bank` = '21'),`b`.`jumlah`,0) AS `k21`,
IF((`b`.`id_transaksi_bank` = '22'),`b`.`jumlah`,0) AS `k22`,
IF((`b`.`id_transaksi_bank` = '23'),`b`.`jumlah`,0) AS `k23`
FROM (`t_buku_bank` `b`
JOIN `t_master_transaksi_bank` `tb`
ON ((`tb`.`id` = `b`.`id_transaksi_bank`)))$$

DELIMITER ;

我收到错误代码:1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF((b.id_transaksi_bank = '11'),b.jumlah,0) AS m11,
IF((b.`id_tran' at line 1

请帮助我,我是 mysql 新手

最佳答案

您有两个 $$ 破坏了您的查询:

ON ((`ap`.`id` = `b`.`id_akun_pendapatan`)))$$

ON ((`tb`.`id` = `b`.`id_transaksi_bank`)))$$

删除它们并重试

关于mysql - 错误代码: 1064 | Delimiter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30096836/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com