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
(from|join)\s+\w+\.((\w*)[as ]+(\w+))
should return what you're looking for in the second capture group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With