-
Notifications
You must be signed in to change notification settings - Fork 126
Open
Labels
Description
I have the below sql query in MSSQL.
SELECT
ap.[AccountId],
(SELECT COUNT(*) FROM [Transactions] t WHERE t.[AccountId] = ap.[AccountId]) AS TransactionCount
FROM
[AccountProfiles] apI am using the Parser class and the columns_dict method contains the SELECT sql clause which do not take into account the subqueries.
parser = Parser(subquery)
tables = parser.tables
columns_dict = parser.columns_dictAs you can see from the sql query and the final output below in json format, in the Tables section registers the table from the subquery. In Select clause it does not contain the TransactionCount and it also takes the Where clause which is contained inside the subquery.
{
"Tables": [
"[Transactions]",
"[AccountProfiles]"
],
"Select": [
"[AccountProfiles].[AccountId]"
],
"Where": [
"[Transactions].[AccountId]",
"[AccountProfiles].[AccountId]",
"*"
]
}Reactions are currently unavailable