Describe the bug
Throwing error when adding `HAVING
DATEDIFF(
DAY,
CONVERT(DATE, MIN(O.Order_Date)),
CONVERT(DATE,GETDATE())
)
7`
Database Engine
MS SQL
To Reproduce
-the SQL that be parsed
`SELECT ct.Client_ID,ct.Name,ct.[Email Address],ct.Country,ct.Language,ct.Phone,ct.Teacher_ID
FROM Clients_Of_The_Teacher ct
INNER JOIN Orders_DE o on ct.Client_ID=o.Client_ID
GROUP BY ct.Client_ID,ct.Name,ct.[Email Address],ct.Country,ct.Language,ct.Phone,ct.Teacher_ID
HAVING
DATEDIFF(
DAY,
CONVERT(DATE, MIN(O.Order_Date)),
CONVERT(DATE,GETDATE())
)
7`
-the node-sql-parser version v5.3.2
-the node version: node v20.17.0
Describe the bug Throwing error when adding `HAVING DATEDIFF( DAY, CONVERT(DATE, MIN(O.Order_Date)), CONVERT(DATE,GETDATE()) )
Database Engine MS SQL
To Reproduce -the SQL that be parsed `SELECT ct.Client_ID,ct.Name,ct.[Email Address],ct.Country,ct.Language,ct.Phone,ct.Teacher_ID FROM Clients_Of_The_Teacher ct INNER JOIN Orders_DE o on ct.Client_ID=o.Client_ID GROUP BY ct.Client_ID,ct.Name,ct.[Email Address],ct.Country,ct.Language,ct.Phone,ct.Teacher_ID HAVING DATEDIFF( DAY, CONVERT(DATE, MIN(O.Order_Date)), CONVERT(DATE,GETDATE()) )
Error
SyntaxError: Expected "!=", "#", "#-", "#>", "#>>", "%", "&", "&&", "*", "+", ",", "-", "--", "->", "->>", "/", "/*", "<", "<<", "<=", "<>", "<@", "=", ">", ">=", ">>", "?", "?&", "?|", "@>", "AND", "BETWEEN", "IN", "IS", "LIKE", "NOT", "ON", "OR", "OVER", "REGEXP", "RLIKE", "USING", "XOR", "^", "div", "|", "||", or [ \t\n\r] but ")" found.
Expected behavior Parsed