EXCEL中SQL条件选择2

SELECT

`'Big Grid$'`.品类, round(sum(`'Big Grid$'`.付款金额),0) as 付款金额, round(sum(`'Big Grid$'`.销售数量),0) as 销售数量, round(sum(`'Big Grid$'`.买家数),0) as 买家数, round(avg(`'Big Grid$'`.客单价),0) as 客单价

FROM

`E:\OneDrive - business\Desktop\20190728.xlsx`.`'Big Grid$'` `'Big Grid$'`

WHERE

(`'Big Grid$'`.品类=? or ? = '全部')and(`'Big Grid$'`.门店名称=? or ? = '全部')

GROUP BY `'Big Grid$'`.品类

 

posted @ 2019-07-29 20:18  佛系程序员  阅读(186)  评论(0编辑  收藏  举报