andialbrecht / sqlparse

A non-validating SQL parser module for Python
BSD 3-Clause "New" or "Revised" License
3.71k stars 693 forks source link

No supporting for intersection #713

Open YeWenjia opened 1 year ago

YeWenjia commented 1 year ago

if there is a query with intersection and where:

select 1 from foo where 1 =1 intersect select 2 from foo

the token of where will contain the intersection part which means that it does not take "intersect" as a keyword.

we have a simple solution:

In the Where class of sql.py file, we add 'INTERSECT' in the M_CLOSE.