Created
August 12, 2021 15:45
-
-
Save William9923/a8d075a28bd38a45714382c3304c55eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| insert into staging.dim_product ( | |
| product_id, | |
| product_category, | |
| product_name_length, | |
| product_description_length, | |
| product_photos_qty, | |
| product_weight_g, | |
| product_length_cm, | |
| product_height_cm, | |
| product_width_cm, | |
| is_current_version | |
| ) | |
| (select | |
| product_id, | |
| CASE | |
| when product_category is not null then product_category | |
| else 'OTHER' | |
| END as product_category, | |
| product_name_length, | |
| product_description_length, | |
| product_photos_qty, | |
| product_weight_g, | |
| product_length_cm, | |
| product_height_cm, | |
| product_width_cm, | |
| true as is_current_version | |
| from live.product | |
| where product_id not in (select product_id from staging.dim_product)); | |
| -- Notes : Inserting new data on product dimenstion table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment