,當我跑在Navicat的EXPLAIN的看法表,無法揣摩出究竟在這個簡短的代碼中的錯誤,我得到這個MySQL錯誤1064:的MySQL [錯誤] 1064
SET @runningbal = 0;
SELECT
cashinflow_v.TxnDate,
cashinflow_v.TxnType,
cashinflow_v.Amount,
@runningbal := @runningbal + cashinflow_v.Amount as Balance
FROM
cashinflow_v
ORDER BY cashinflow_v.TxnDate
錯誤說:
[SQL] EXPLAIN SET @runningbal = 0;
SELECT
cashinflow_v.TxnDate,
cashinflow_v.TxnType,
cashinflow_v.Amount,
@runningbal := @runningbal + cashinflow_v.Amount as Balance
FROM
cashinflow_v
ORDER BY cashinflow_v.TxnDate
[Err] 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 'SET
@runningbal = 0;
SELECT
cashinflow_v.TxnDate,
cashinflow_v.TxnType,
cash' at line 1
如果有人能夠幫助我,我將不勝感激。謝謝!
設置前是否有密碼? –
沒有。我正在使用Navicat。 – Cioden