Web_THBC 为表示层也就是页面(.aspx)

BLL_THBC 为业务逻辑层
DAL_THBC 为数据库交互层 (向数据库执行SQL语句)
Model_THBC 为实体类
DbHelper 为数据库连接类

统计个专营店的男女数量

  
select dua.UARTERS_ID,dua.UARTERS_NAME
,sum(case when sex = '1' then 1 else 0 end) as Man
,sum(case when sex = '0' then 1 else 0 end) as Woman
from dbo.DCAD_USER as du
left join  
dbo.DCAD_UARTERS as dua
on du.UARTERS_ID = dua.UARTERS_ID
group by dua.UARTERS_ID,dua.UARTERS_NAME