Skip to main content

Snowflake general functions

In this article, we’ll be discussing some powerful SQL general functions, which are                                    

                                    1. NVL 

                                    2. NVL2 

                                    3. DECODE 

                                    4. COALESCE 

                                    5. NULLIF 

                                    6. NULLIFZERO.

        All these functions work with any data type and pertain to the use of null values in the expression list. These are all single row function i.e. provide one result per row.

To explain all these functions in detail, will consider the Product table data .

        Let's create a table, schema and the product table. After table creation will try to insert some data for demonstration purpose.

Step 1 : Create a database named as DEV_DB.

Database






Step 2 : Create a Schema named as Sales under database DEV_DB.



Step 3 : Create a fact table named as FACT_PRODUCT.



Step 4 : Insert some data in the FACT_PRODUCT.





1. NULLIF 

Comments