我目前正在使用 select 语句在不同的时间间隔内使用 1 个 kiosk 系统慢慢获取不同会员类别的会员惠顾。
SELECT COUNT(MemberID) from Member where signin >= '13-10-2013 09:00' and signout <= '13-10-2013 15:00' and MemberType = 1 and kioskid = 1
SELECT COUNT(MemberID) from Member where signin >= '13-10-2013 15:00' and signout <= '13-10-2013 20:00' and MemberType = 1 and kioskid = 1
SELECT COUNT(MemberID) from Member where signin >= '13-10-2013 09:00' and signout <= '13-10-2013 15:00' and MemberType = 2 and kioskid = 1
SELECT COUNT(MemberID) from Member where signin >= '13-10-2013 15:00' and signout <= '13-10-2013 20:00' and MemberType = 2 and kioskid = 1
有没有办法让我在一个查询中一起抓取数据,如下所示:
| 09:00 - 15:00 | 15:00 - 20:00
Premium Member | 21 | 55
Standard Member | 100 | 300