I'm new to Linux and I'm looking for a regex (sed) or other simple way to format the SQL like
select ABREV from LIMITS, ABREV where ABREV='US'
select ABREV from SCHEMA.LIMITS, SCHMEA.ABREV where ABREV='US'
sed 's/\(select.*from[ ]*\)\([A-Za-z0-9_]\)\(.*\)/\1SCHEMA.\2\3/'
but it produces only
select ABREV from SCHEMA.LIMITS, ABREV where ABREV='US'
any help please?
P.S. There may be any number of table names