Перевожу запрос SQL Developer:
SELECT DISTINCT
sCall.id AS call_object_id,
'<a href="https://help.company.ru/sd/operator/#uuid:serviceCall$'
|| sCall.id
|| '">'
|| sCall.title
|| '</a>'
AS Call_link,
sCall.title AS call_id,
NVL (mark.code, 0) AS mark
FROM nausd40.tbl_serviceCall sCall,
nausd40.tbl_mark mark
where
sCall.mark = mark.id(+)
Мой перевод на Postgres:
select DISTINCT
sCall.id AS call_object_id,
'<a href="https://help.company.ru/sd/operator/#uuid:serviceCall$'
|| sCall.id
|| '">'
|| sCall.title
|| '</a>'
AS Call_link,
sCall.title AS call_id,
COALESCE(mark.code, 0) AS mark
FROM tbl_serviceCall sCall
left join tbl_mark mark on (sCall.mark = mark.id)
Выдает ошибку:
SQL Error [42804]: ERROR: COALESCE types character varying and integer cannot be matched
Подскажите, что сделал не так.
COALESCE(mark.code :: integer, 0) AS mark
.