We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The parser fails with an error when parsing a COUNT(DISTINCT ...) expression. It seems that the AST cannot represent this expression.
COUNT(DISTINCT ...)
package main import ( "bytes" "log" "github.com/akito0107/xsqlparser" "github.com/akito0107/xsqlparser/dialect" ) func main() { sql := "SELECT COUNT(DISTINCT id) FROM foo" parser, _ := xsqlparser.NewParser(bytes.NewBufferString(sql), &dialect.MySQLDialect{}) _, err := parser.ParseStatement() if err != nil { log.Fatalln(err) } }
Error:
2022/06/10 15:31:33 parseQueryBody failed: parseSelect failed: parseSelectList failed: ParseExpr failed: parsePrefix failed: parseFunction failed: expected RParen but &{Kind:SQLKeyword Value:id From:{Line:1 Col:23} To:{Line:1 Col:25}} exit status 1
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
The parser fails with an error when parsing a
COUNT(DISTINCT ...)
expression. It seems that the AST cannot represent this expression.Example:
Error:
The text was updated successfully, but these errors were encountered: