You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WITH RecursiveCTE AS (
-- Anchor memberSELECT TOP 1
[ID],
CAST([Amount] ASNUMERIC) AS [Amount],
CAST([Balance] ASNUMERIC) AS [Balance],
(SELECT TOP 1 [FixedValue] FROM [Settings] ORDER BY [ID] DESC) AS [Constant]
FROM [Transactions]
ORDER BY [ID] ASCUNION ALL-- Recursive memberSELECT
[ID] +1AS [ID],
CAST([Amount] *0.8ASNUMERIC) AS [Amount],
CAST(([Amount] *0.8- [Constant]) ASNUMERIC) AS [Balance],
[Constant]
FROM RecursiveCTE
WHERE [Balance] >0
)
SELECT [ID], [Balance]
FROM RecursiveCTE
ORDER BY [ID] ASC;
it gives the following error
sql parser error: Expected: ), found: UNION at Line: 11, Column: 5
Hi, the following is a valid MSSQL syntax
When parsed with the
sql-parser-rs
it gives the following error
https://learn.microsoft.com/en-us/sql/t-sql/queries/with-common-table-expression-transact-sql
The text was updated successfully, but these errors were encountered: