This repository was archived by the owner on Oct 8, 2019. It is now read-only.

Description
SQL Parser is not able to correctly parse WITH clauses. When I try to analyze the following MS SQL statement, I am not getting the WITH node in the JSON output. When using the SQL Parser demo I get: 'syntax error, state:686(10101) near: PersonCTE(1,8)'
WITH PersonCTE (BusinessEntityID, FirstName, LastName)
AS (SELECT Person.BusinessEntityID,
FirstName,
LastName
FROM Person.Person
WHERE LastName LIKE 'C%'),
PhoneCTE (BusinessEntityID, PhoneNumber)
AS (SELECT BusinessEntityID,
PhoneNumber
FROM Person.PersonPhone)
SELECT FirstName,
LastName,
PhoneNumber
FROM PersonCTE
INNER JOIN
PhoneCTE
ON PersonCTE.BusinessEntityID = PhoneCTE.BusinessEntityID