sql: use last " as " to find name token for column
We were using the first ' as ', which causes problems for the following types of lines CAST(SUM(of.debit) AS BIGINT) as debit
This commit is contained in:
parent
75c89f0b8e
commit
967c56859f
|
@ -110,7 +110,7 @@ def colname_htable(query):
|
|||
for colnum, colname in enumerate(colnames):
|
||||
colname = colname.strip()
|
||||
# SELECT xxx AS yyy -> Y
|
||||
as_clause = colname.upper().find(" AS ")
|
||||
as_clause = colname.upper().rfind(" AS ")
|
||||
if as_clause != -1:
|
||||
colname = colname[as_clause + 4:].strip()
|
||||
|
||||
|
|
Loading…
Reference in New Issue