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

Unable to relate column names with table name in case of sub query

Open analyst009 opened this issue 3 years ago • 0 comments

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?

analyst009 avatar Jan 23 '22 17:01 analyst009