Multiple COUNT SELECTS from the same table in one query

前端 未结 2 817
暗喜
暗喜 2021-02-05 04:41

For some people it might look very simple, but I just simply can\'t get it.
I have multiple MS-SQL SELECT queries from the same table over and over:

         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 05:06

    SELECT sum(case when Page LIKE '%AEC%' then 1 end) as tAEC, 
        sum(case when Page LIKE '%TOL%' then 1 end) as tTOL 
    FROM someTable 
    

提交回复
热议问题