Skip to content

Commit ac547c0

Browse files
committed
add parsing rule for 1INTERSECT DISTINCT
1 parent 16c9401 commit ac547c0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mindsdb_sql_parser/parser.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,10 +1069,13 @@ def union(self, p):
10691069
@_('select INTERSECT select',
10701070
'union INTERSECT select',
10711071
'select INTERSECT ALL select',
1072-
'union INTERSECT ALL select')
1072+
'union INTERSECT ALL select',
1073+
'select INTERSECT DISTINCT select',
1074+
'union INTERSECT DISTINCT select')
10731075
def union(self, p):
10741076
unique = not hasattr(p, 'ALL')
1075-
return Intersect(left=p[0], right=p[2] if unique else p[3], unique=unique)
1077+
return Intersect(left=p[0], right=p[-1], unique=unique)
1078+
10761079
@_('select EXCEPT select',
10771080
'union EXCEPT select',
10781081
'select EXCEPT ALL select',

0 commit comments

Comments
 (0)