sql-metadata
sql-metadata copied to clipboard
Unable to relate column names with table name in case of sub query
Hi, I am using following query. In this, two tables and two columns (columns_dict['where']) are the output. There is not info to relate which column corresponds to which table.
"SELECT flowchartid, campaignid, aclid FROM informix.UA_Flowchart WHERE campaignid IN ( SELECT DISTINCT(campaignid) FROM informix.UA_Campaign WHERE folderid = 2 ) "
output of
table_name = Parser(query).tables column_name = Parser(query).columns_dict['where']
IS
['informix.UA_Flowchart', 'informix.UA_Campaign'] ['campaignid', 'folderid']
how to know which columns belong to which table?