partition (dt=substr(regexp_replace(cast(now() as string),’-‘,”),1,8))
SELECT
c.name as drp_store_name,–店仓名称
cast(c.code as string) as drp_store_code,–店仓编号
b.no_sku as drp_product_code,–商品条码
d.name as drp_product_name,–款号
a.qty as drp_product_qty,–账面数量
a.creationdate as creation_date,–创建时间
a.modifieddate as modified_date,–修改时间
f.value1_code color,–颜色
f.value2_code size–尺寸
FROM cc_drp.fa_storage a –728345
inner join cc_drp.m_product_alias_coy b on trim(cast(a.m_productalias_id as string))=trim(cast(b.id as string)) –728345
inner join (select * from cc_drp.c_store where ISACTIVE=’Y’ and M_DIM1_ID=1 ) c on trim(cast(a.c_store_id as string))=trim(cast(c.id as string)) –728345
inner join (select * from cc_drp.m_product where ISACTIVE=’Y’ and M_DIM1_ID=1 ) d on trim(cast(a.m_product_id as string))=trim(cast(d.id as string))
inner join cc_drp.m_attributesetinstance f on b.m_attributesetinstance_id=f.id