I have a very large SQL query. I am trying to scrape tables names using javascript out of SQL query. (I provide SQL query in a text file as input)
select t1.name, t1.id, t1.address, t2.units,t2.sale
from SCHMEA1.candy_customers_azim_056 as t1
inner join SCHEMA1.candy_sales_history_set t2
on (t1.custid = t2.ORIGTN_ACCT_NO)
What could be the regular expression to achieve something like this ?
Tables:
candy_customers_azim_056 as t1
candy_sales_history_set t2
candy_[a-z0-9_]*\s(as\s)?t[0-9]select * from table1, table2?