Това решава ли проблема ви?
SELECT
COALESCE(<Some Math Logic>, 'false')
FROM table_2 T2
LEFT JOIN table T
ON T.Id = T2.Id
and T2.value = 1
WHERE <where clause>
Това решава ли проблема ви?
SELECT
COALESCE(<Some Math Logic>, 'false')
FROM table_2 T2
LEFT JOIN table T
ON T.Id = T2.Id
and T2.value = 1
WHERE <where clause>