sql-metadata icon indicating copy to clipboard operation
sql-metadata copied to clipboard

WHERE clause mistaken for table alias

Open geokats opened this issue 2 years ago • 0 comments

When the query SELECT name from employee WHERE age > 25 is parsed, the resulting table_aliases are {'WHERE': 'employee'}.

Code to reproduce with sql_metadata == 2.10.0

import sql_metadata
parser = sql_metadata.Parser("SELECT name from employee WHERE age > 25")
print(parser.tables_aliases)

geokats avatar Nov 15 '23 15:11 geokats