Open AsliRoy opened 6 years ago
What do you want to achieve? From what I can see the statement parses fine:
>>> print(sqlparse.format(sql, reindent=True)) # where sql is your statement
SELECT sub.*
FROM
(SELECT *
FROM tutorial.sf_crime_incidents_2014_01
WHERE day_of_week = 'Friday') sub
WHERE sub.resolution = 'NONE'
@andialbrecht , thank you for replying. Is there any way that the parser can be made to distinguish between the two select statements. Say for example on the given input, can it , say, separate it into two strings, and store them separately? Obviously, the dependency of the first string on the substring is noted. I just want them as two different strings, after parsing.
I was trying to get this running with nested select statements, so I was wondering if you have a work-around for that. My SQL statement was something like,
SELECT sub.* FROM (SELECT * FROM tutorial.sf_crime_incidents_2014_01 WHERE day_of_week = 'Friday') sub WHERE sub.resolution = 'NONE'
Can this be made to work? Thanks for the time. Cheers!