【发布时间】:2022-01-02 06:09:13
【问题描述】:
当我运行下面显示的查询时,它会给出错误消息。请帮我改正
select Debit_ID,Debit_Date,Debit_Note,Deb_Code,Debit_Amount,Settlement,Debit_Amount-Settlement as Balance
from
(SELECT id Debit_ID,date Debit_Date ,reference_no Debit_Note ,customer_id Deb_Code,total Debit_Amount,
(select nvl(sum(amount),0) from sma_payments where type='received' and sma_sales.id=sma_payments.sale_id)Settlement
from sma_sales where customer_id<>1 and sma_sales.sale_status='completed')
[Err] 1064 - 您的 SQL 语法有错误;检查与您的 MariaDB 服务器版本相对应的手册,以获取正确的语法,以便在第 6 行的 '' 附近使用
【问题讨论】: