I am doing a migration from mssql to postgresql and I am facing issue in resolving one of the queries.
My Query:
SELECT 1,
CASE
WHEN cast((case
when split_part(mt_outward_qty,'/',1) > '0' then
substring(mt_outward_qty,0,split_part(mt_outward_qty,'/',1)::int)
when split_part(mt_outward_qty,'.',1)>'0' then
substring(mt_outward_qty,0,split_part(mt_outward_qty,'.',1)::int)
else
mt_outward_qty
end) as int) > 0
THEN 'Y'
ELSE 'N'
END
from STL_CS_Tra_requestdetails
LEFT JOIN STL_CS_Tra_storeopening ON req_id = so_requestid
LEFT JOIN STL_CS_Tra_multiple_timinig ON req_id = mt_reqid
Upon executing this, I am getting:
invalid input syntax for integer: ""
Kindly help me in resolving this.