sql - Invalid Identifier. Is it the concat code? -
i keep getting error "invalid identifier" , know columns right... thoughts?
also, know concat coding kind of messy. offered code it:
,mp_asin.parent_asin_name || ', ' || mp_asin.color_name teen
which better?
select mp_asin.category_code category_id ,mp_asin.subcategory_code subcategory ,mp_asin.parent_asin ,mp_asin.parent_asin_name ,mp_asin.color_name color_name ,mp_asin.product_site_launch_day psld ,concat(mp_asin.parent_asin_name, concat(',', concat(' ',mp_asin.color_name))) teen ,mp.brand_code brand_code ,mp.replenishment_code replen_code ,mp.replenishment_category_id replen_tier ,mp.asin asin , min(mp.replenishment_code) on (partition (concat(mp_asin.parent_asin_name, concat(',', concat(' ',mp_asin.color_name))))) min_teen_rc , max(mp.replenishment_code) on (partition (concat(mp_asin.parent_asin_name, concat(',', concat(' ',mp_asin.color_name))))) max_teen_rc d_mp_asins mp min_teen_rc <> max_teen_rc , mp.product_category =('30905500') , mp_asin.subcategory_code =('30905560') , mp.region_id = 1 , mp.marketplace_id = 1 , mp.gl_product_group = 309 group mp_asin.category_code ,mp_asin.subcategory_code ,mp_asin.parent_asin ,mp_asin.parent_asin_name ,mp_asin.color_name ,mp_asin.product_site_launch_day ,concat(mp_asin.parent_asin_name, concat(',', concat(' ',mp_asin.color_name))) ,mp.brand_code ,mp.replenishment_code ,mp.replenishment_category_id ,mp.asin
i think missed table alias mp_asin. see 1 table in from
clause.
this better , more readable:
mp_asin.parent_asin_name || ', ' || mp_asin.color_name teen
Comments
Post a Comment