postgresql-parser icon indicating copy to clipboard operation
postgresql-parser copied to clipboard

syntax error: at or near "‹)›"

Open Kikkon opened this issue 2 years ago • 3 comments

Hi I'm currently facing an issue while use postgresql-parser. During my usage, I encountered an error with the following code snippet:

code:

	sql := "SELECT PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY id) FROM test_table"
	stmt, err := parser.ParseOne(sql)

error msg:

 "syntax error: at or near "‹)›"

I'm not very familiar with the inner workings of the parser and would greatly appreciate any assistance you can provide. I'm more than willing to contribute code to fix this problem if you could kindly point me in the right direction.

Kikkon avatar Jun 09 '23 03:06 Kikkon

🤣 I have discovered this is an unsupported syntax.

Kikkon avatar Jun 09 '23 03:06 Kikkon

WITHIN is not common expr in SQL, which kinds of SQL dialect you are using?

auxten avatar Jun 09 '23 07:06 auxten

WITHIN is not common expr in SQL, which kinds of SQL dialect you are using?

I'm using the Postgres SQL dialect, and I found that WITHIN is supported in the latest cockroach DB

Kikkon avatar Jun 20 '23 10:06 Kikkon