select ID,sum(IF_IN),sum(IF_OPEN) from tabname group by ID
select id,sum(IF_IN) as IF_IN,sum(IF_OPEN) as IF_OPEN from table group by id
select ID ,sum(IF_IN) ,sum(IF_open) from 表 group by id
select count(id), if_in, if_open from app_table where if_in = 1 and if_open = 1 group by id
select id,Count(IF_IN),Count(IF_OPEN) From table Where IF_IN=1 AND IF_OPEN=1 Group BY ID
select ID,sum(IF_IN),sum(IF_OPEN) from tabname group by ID
select id,sum(IF_IN) as IF_IN,sum(IF_OPEN) as IF_OPEN from tablename group by id
select a.id,a.IF_IN,isnull(b.IF_OPEN,0)IF_OPEN from (select id, count(IF_IN) IF_IN from tablename where IF_IN>0 group by c.id) a left join (select id, count(IF_OPEN) IF_OPEN from tablename where IF_OPEN>0 group by c.id) b on a.id=b.id
from table
group by id
,sum(IF_IN)
,sum(IF_open)
from 表
group by id
where if_in = 1 and if_open = 1
group by id
From table
Where IF_IN=1 AND IF_OPEN=1
Group BY ID
from tablename
group by id
(select id, count(IF_IN) IF_IN from tablename where IF_IN>0 group by c.id) a left join
(select id, count(IF_OPEN) IF_OPEN from tablename where IF_OPEN>0 group by c.id) b on a.id=b.id