QuestionQ90Verified/Retrieving data using the SQL SELECT statementCopy linkReport a problemAsk AstroTutorSave questionWhich two of the following queries execute successfully?Choose twoASELECT NULLIF (NULL, 100) FROM DUAL;BSELECT NULLIF (100, ‘A’) FROM DUAL;CSELECT NULLIF (100, 100) FROM DUAL;DSELECT COALESCE (100, NULL, 200) FROM DUAL;ESELECT COALESCE (100, ‘A’) FROM DUAL;Show AnswerAnswerExplanationNULLIF cannot use a literal NULL as its first expression; when its arguments are not both numeric, they must have the same data type. NULLIF(100, 100) is valid and returns NULL. COALESCE(100, NULL, 200) is valid and returns the first non-null value, 100. A numeric expression combined with the character literal ‘A’ is not type-compatible for these expressions.Learn moreOracle Database SQL Language Reference: NULLIFOracle Database SQL Language Reference: COALESCEShow comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion