TylerBrinks / SqlParser-cs

A Friendly SQL Parser for .NET
MIT License
94 stars 19 forks source link

Expression with SUM in HAVING #20

Open pantonis opened 2 months ago

pantonis commented 2 months ago

I want to produce this sql query

SELECT 
    CountryId,
    SUM(Profit),
    SUM(Tax)    
FROM [Orders]
GROUP BY CountryId
HAVING SUM(Profit) > 0

How can I create the expression that contains the SUM(Profit) to be used in HAVING clause?

TylerBrinks commented 3 weeks ago

I'm unclear what you're trying to do. Are you trying to parse that query or produce an abstract syntax tree representation? Can you elaborate?