I have to migrate complex SQL query need to convert in Postgres.
Complex SQL query : More than 4 table Join , lots of filter , Aggregate functions, CASE when then etc.
For Ex: Sample input
Select
ROW_NUMBER() OVER (ORDER BY getdate()) AS ID,
GETDATE() as time,
arc.Customer as Customer,
GroupBy4KPI,
arc.MasterAccount,
arc.CustomerClass,
from tablename_1 arc left join tablename_2 varc on arc.Customer = varc.Customer
Please suggest if we have any custom function or tool to accomplish conversion of DML statement from MSSQL to PSQL.
Fact
Such, 1600 Queries i have to parse. So, this job is repetitive one. i have to perform or parse MSSQL queries on daily basis.
Any help on it would be much appreciated ?