Query is insert statement along with with as and select statement. It was running good previously but suddenly in production it errored out with this message. Couldn't find the reason behind it There was change in connection details
Insert into table a
(col1,
col2)
with abc
as( select stmt)
def
as( select stmt)
ghi
as( select stmt)
select x,y,z
from abc
left join def on stmt
left join ghi on stmt