2/12/2024 0 Comments Decode sqlserverThis function is useful for mapping NaN values to NULL. If n1 is not NaN, then database returns n1. It instructs the Database to return an alternative value n2 if the input value n1 is NaN (not a number). NANVL() : The NANVL function is useful only for floating-point numbers of type BINARY_FLOAT or BINARY_DOUBLE.It takes as an argument a condition and returns TRUE if the condition is FALSE or UNKNOWN and FALSE if the condition is TRUE.Įxamples – SELECT COUNT(*) FROM employees The function can be used only in the WHERE clause of a query. LNNVL() : LNNVL evaluate a condition when one or both operands of the condition may be null.NULLIF(LENGTH(first_name),LENGTH(last_name)) You cannot specify the literal NULL for first expression. If they are not equal, the function returns the first expression. If they are equal, the function returns null. NULLIF() : The NULLIF function compares two expressions.In simple words COALESCE() function returns the first non-null expression in the list.ĬOALESCE(commission_pct, salary, 10) comm The advantage of the COALESCE() function over the NVL() function is that the COALESCE function can take multiple alternate values. COALESCE() : The COALESCE() function examines the first expression, if the first expression is not null, it returns that expression Otherwise, it does a COALESCE of the remaining expressions.If the default value is omitted, a null value is returned where a search value does not match any of the result values. If the expression is the same as search, result is returned. The DECODE function decodes expression after comparing it to each search value. The DECODE function decodes an expression in a way similar to the IF-THEN-ELSE logic used in various languages. DECODE() : Facilitates conditional inquiries by doing the work of a CASE or IF-THEN-ELSE statement.SELECT last_name, salary, commission_pct, Software Engineering Interview Questions.Top 10 System Design Interview Questions and Answers.Top 20 Puzzles Commonly Asked During SDE Interviews.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |