SQL select case

本文详细解析了特定时间段内,不同供应商ID、商品ID、商家ID下的销售数据,通过条件筛选与分组聚合,揭示了商品分类与销售趋势的关系。分析了包括BestBuy、Replink、Buy.com等知名电商平台的销售表现,提供了对电子商务业务策略制定的参考。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

select var_id, program_id, case merchant_id
when '200' then 'bestbuy'
when '300' then 'Replink'
when '500' then 'Buy.com'
when '30000' then 'ALMO'
when '30025' then 'BabyAge.com'
when '30050' then 'Bambeco'
when '30225' then 'cooking.com'
when '30060' then 'Bass Pro Shops'
when '30225' then 'Cooking.com'
when '30300' then 'Discount Golf World'
when '30355' then 'DSI Systems'
when '30360' then ' eBags'
when '30455' then ' Petra'
when '30475' then 'Sears'
when '30575' then 'ShoeBuy.com'
when '30585' then 'ShoppersChoice.com'
when '30825' then ' Unbeatable'
when '30830' then 'Mercent'
when '30850' then 'Premco'
when '70000' then 'Koinz'
else merchant_id
end
,count(*) as count from order_line
where create_date<='2011-10-25' and create_date>='2011-06-01' and supplier_id='200' and var_id in('b2s_qa','B2S_LIVE' ) and order_status<>'11'
group by var_id, program_id, merchant_id
order by var_id, program_id, merchant_id

select merchant_id, name from merchant

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值