select count(1) from pd_xxx_origin_xxx_data where create_time like '2019-02-23%' and source='20036'
 
SELECT 
sum(case when create_time like '2019-02-23%' then 1 else 0 end) as inst_count,
sum(case when active_time like '2019-02-23%' then 1 else 0 end) as active_count
 FROM `pd_xxx_origin_xxx_data` where  charindex('20036',source );
 
SELECT 
sum(case when create_time like '2019-02-23%' then 1 else 0 end) as inst_count,
sum(case when active_time like '2019-02-23%' then 1 else 0 end) as active_count
 FROM `pd_xxx_origin_xxx_data ` where  source like '20036%';
 
SELECT 
sum(case when create_time like '2019-02-23%' then 1 else 0 end) as inst_count,
sum(case when active_time like '2019-02-23%' then 1 else 0 end) as active_count
 FROM `pd_xxx_origin_xxx_data` where  source='20052';
 

相关文章:

  • 2021-08-27
  • 2022-03-01
  • 2021-10-04
猜你喜欢
  • 2021-07-23
  • 2022-12-23
  • 2021-09-03
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
相关资源
相似解决方案