17,086
社区成员
发帖
与我相关
我的任务
分享
select mar.*
SUM(decode(status_publish,
0,
0,
round((g.count_official /
status_publish),
1))) as countA
from
(select h.departid,
c.departname,
a.displayname,
f.title_id,
f.title_name,
g.count_media,
count(decode(b.info_status, '3', '已发布', null)) status_publish
from user_t a,
e_infomation b,
edepart c,
e_title_info e,
e_infotitle f,
e_target g,
e_infodepart h
where h.content_id = b.content_id
and e.title_id = f.title_id
and c.departid = h.departid
and b.content_id = e.content_id
and g.targetyear = f.title_id
and crtdate >= to_date(concat(to_char(trunc(sysdate, 'mm'), 'yyyy-MM-dd'),
' 00:00:00'),
'yyyy-MM-dd HH24:mi:ss')
and crtdate <=
to_date(concat(to_char(last_day(sysdate), 'yyyy-MM-dd'), ' 23:59:59'),
'yyyy-MM-dd HH24:mi:ss')
) mar
group by mar.departid,
mar.departname,
mar.displayname,
mar.title_id,
mar.title_name,
mar.count_official,
mar.count_media
select mar.*
SUM(decode(status_publish,
0,
0,
round((g.count_official /
status_publish),
1))) as countA
from
(select h.departid,
c.departname,
a.displayname,
f.title_id,
f.title_name,
g.count_media,g.count_official,
count(decode(b.info_status, '3', '已发布', null)) status_publish
from user_t a,
e_infomation b,
edepart c,
e_title_info e,
e_infotitle f,
e_target g,
e_infodepart h
where h.content_id = b.content_id
and e.title_id = f.title_id
and c.departid = h.departid
and b.content_id = e.content_id
and g.targetyear = f.title_id
and crtdate >= to_date(concat(to_char(trunc(sysdate, 'mm'), 'yyyy-MM-dd'),
' 00:00:00'),
'yyyy-MM-dd HH24:mi:ss')
and crtdate <=
to_date(concat(to_char(last_day(sysdate), 'yyyy-MM-dd'), ' 23:59:59'),
'yyyy-MM-dd HH24:mi:ss')
) mar
group by mar.departid,
mar.departname,
mar.displayname,
mar.title_id,
mar.title_name,
mar.count_official,
mar.count_media