Check if the value is null

linkaiyi
Follow

You can use NVL:

NVL(col, 0)

or COALESCE:

COALESCE(col, 0)

value depends on select results

SELECT  Q.*, 
        CASE WHEN A.Question_ID IS NULL THEN 0 ELSE 1 END Answered
FROM Question Q
LEFT JOIN ( SELECT DISTINCT Question_ID
            FROM Answer) A
    ON Q.ID = A.Question_ID;
Object has 0 attachments

Was this article helpful?

This article is viewed 55 times!

Recent Viewed Articles

0 Comments

Leave a Comment

Support