读书人

取得本周截止到当前为止所有用户的签

发布时间: 2012-07-25 09:43:05 作者: rapoo

获得本周截止到当前为止,所有用户的签到次数

select t.usermobile,       themeId,       to_char(trunc(sysdate, 'iw'), 'yyyy-mm-dd') begintime,       to_char(trunc(sysdate, 'iw') + 6, 'yyyy-mm-dd') endtime,       count(distinct t.attenddate) countOfAttendance  from user_attendance t where attenddate >= to_char(trunc(sysdate, 'iw'), 'yyyy-mm-dd')   and attenddate <= to_char(sysdate, 'yyyy-mm-dd') group by usermobile, themeid;


表结构
create table USER_ATTENDANCE
(
ID NUMBER(9) not null,
USERMOBILE VARCHAR2(15) not null,
THEMEID NUMBER(9),
ATTENDDATE VARCHAR2(19) not null
)

读书人网 >其他数据库

热点推荐