调整 字段顺序、名称
This commit is contained in:
@@ -54,6 +54,7 @@ shop_listing_latest AS (
|
||||
sales_summary AS (
|
||||
SELECT
|
||||
fs."统一规格编码",
|
||||
fs."店铺主键",
|
||||
SUM(
|
||||
CASE
|
||||
WHEN fs."发货时间" >= date_trunc('month', now())
|
||||
@@ -82,7 +83,7 @@ sales_summary AS (
|
||||
WHERE NULLIF(TRIM(fs."统一规格编码"), '') IS NOT NULL
|
||||
AND fs."发货时间" >= date_trunc('month', now()) - INTERVAL '2 month'
|
||||
AND fs."发货时间" < date_trunc('month', now()) + INTERVAL '1 month'
|
||||
GROUP BY fs."统一规格编码"
|
||||
GROUP BY fs."统一规格编码", fs."店铺主键"
|
||||
),
|
||||
|
||||
product_dim AS (
|
||||
@@ -120,8 +121,8 @@ LEFT JOIN analytics_layer.dim_shop ds
|
||||
ON sl."店铺主键" = ds."店铺主键"
|
||||
LEFT JOIN sales_summary ss
|
||||
ON sl."统一规格编码" = ss."统一规格编码"
|
||||
AND sl."店铺主键" = ss."店铺主键"
|
||||
LEFT JOIN product_dim pd
|
||||
ON sl."统一规格编码" = pd."统一规格编码"
|
||||
ORDER BY sl."统一规格编码", sl."店铺主键"
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user