You can translate the question and the replies:

Teradata equivalent functions

Hi, I have teradata queries as 1. NVL (<fieldname>, 0) 2. Decode (<fieldname>) what is theequivalent functions in denodo for NVL and DECODE?
user
28-11-2023 01:59:46 -0500
code

1 Answer

Hi, In Teradata, the NVL function is used to replace null values with a specified default value. In Denodo, you can achieve the same using the COALESCE function. >For Example: SELECT COALESCE(b, 'hello') FROM V If any of the values in ‘field b’ is NULL, then it is replaced by the default string value ‘hello’. Similarly, the Decode function in Teradata checks the provided expression and replaces the specified value. In Denodo, you can use the CASE statement to achieve similar functionality. >For Example: SELECT id , summary , CASE WHEN LEN(summary) > 22 THEN summary ELSE id END FROM internet_inc Here, when LEN(summary) > 22, then default summary is returned, else value of id is returned. This way, you could use the Denodo functions equivalent to the expected Teradata functions. Hope this helps!
Denodo Team
01-12-2023 05:39:28 -0500
code
You must sign in to add an answer. If you do not have an account, you can register here