select Month(user_lastlogin) as Month,year(user_lastlogin) as Year,
count(*) as 'Total Reg' from bb_user
group by Month(user_lastlogin),year(user_lastlogin)
order by Month desc
select count(*) as 'LR Reg' from bb_user
where user_regtype ='LR'
group by Month(user_lastlogin)
order by Month desc
select count(*) as 'BBR Reg' from bb_user
where user_regtype is null OR user_regtype = 'BBR'
group by Month(user_lastlogin)
order by Month desc
我想显示像月/年/总Reg/LR Reg/BBR Reg
我在 3 个不同的查询中显示结果但我想在一个查询中我想编写存储过程....意味着我想在第一个查询中添加第二个和第三个查询。
user_lastlogin = 注册日期时间