select a.*,row_number()over(partition by dyear,dq order by a.dtime) from ( select to_char(dtime,'YYYY-MM') dYear,mod(to_char(dtime,'MM'),3)+1 dQ, a.* from tb a ) a
select ID, Title, sContent, CreateUser, CreateDate from view1 case when CreateDate<(sysdate - interval '3' month) then 0 else CTR end DESC, CreateDate DESC我现在是这么写的,想请问这么写对吗?
select * from view1 where trunc(createdate+interval '3' month)>trunc(sysdate) order by ctr desc;还真不好猜,不知道这个点击率是否就是这个ctr字段
(
select to_char(dtime,'YYYY-MM') dYear,mod(to_char(dtime,'MM'),3)+1 dQ,
a.* from tb a
) a