select searchcode as keywords, totalcount as count
from (select t.searchcode, sum(b.countNum) as totalcount
from (select contentid, count(contentid) as countNum
from T_US_VIEW_VIDEO_LOG a
where to_date(a.dateStr, 'yyyy-MM-dd') >= SYSDATE - 30
and a.identityid = 10053
group by contentid
order by countNum desc) b,
T_AUDITCONTENT_INFO t
where b.contentid = t.contentid
and t.searchcode is not null
group by searchcode
order by totalcount desc)
WHERE ROWNUM <= 10
from (select t.searchcode, sum(b.countNum) as totalcount
from (select contentid, count(contentid) as countNum
from T_US_VIEW_VIDEO_LOG a
where to_date(a.dateStr, 'yyyy-MM-dd') >= SYSDATE - 30
and a.identityid = 10053
group by contentid
order by countNum desc) b,
T_AUDITCONTENT_INFO t
where b.contentid = t.contentid
and t.searchcode is not null
group by searchcode
order by totalcount desc)
WHERE ROWNUM <= 10