sql 中一对多查询处理

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

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

  

猜你喜欢

转载自www.cnblogs.com/sakura3/p/12618291.html