sql 中一对多查询处理

 

 

 

查看对应运营站一对多门店ID

 

select 
workstation_id
,count(distinct store_id )
from  table
where dt = '20200401'
group by 	
workstation_id
having count(distinct store_id ) >1 ;

  

posted @ 2020-04-02 11:07  Sakura_柏  阅读(1956)  评论(0编辑  收藏  举报