0
我已經努力了,但沒有得到solutin譴責sp下面.. plz幫助!努力解決錯誤1064
CREATE PROCEDURE AccountLedgerViewUnderBank()
begin
WITH GroupInMainGroup (accountGroupId,HierarchyLevel) AS
(
select accountGroupId,
1 as HierarchyLevel
from tbl_AccountGroup where accountGroupId='9'
UNION ALL
select e.accountGroupId,
G.HierarchyLevel + 1 AS HierarchyLevel
from tbl_AccountGroup as e,GroupInMainGroup G
where e.groupUnder=G.accountGroupId
)
SELECT
ledgerId AS 'Account Ledger Id',
acccountLedgerName AS 'Account Ledger Name'
FROM tbl_AccountLedger
where accountGroupId IN (select accountGroupId from GroupInMainGroup
)
end ; //
顯示
ERROR 1064 (42000): 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 'Group InMainGroup (accountGroupId,HierarchyLevel) AS ( select accountGroupId, 1 a' at line 6
MySQL不支持公共表表達式。您需要升級到允許它們的DBMS。 –