79503043

Date: 2025-03-12 08:50:37
Score: 0.5
Natty:
Report link

You could try using COALESCE operator as given below

SELECT 
    c1.ctr_id,
    c1.ctr_id_parent,
    COALESCE(c1.amount, c2.amount) AS amount
FROM fk1 c1
LEFT JOIN fk1 c2
ON c1.ctr_id_parent = c2.ctr_id;
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: MubarakZade