现在要将A表中的数据按照“同一个号码2小时是否重复呼叫”放到B表中。咋做?
update B
set 2小时内重复呼叫量 = (select count(*)
from A
where B.客服id = A.客服id
and 呼叫时间 >= sysdate + 1/24 * 2
group by 电话号码
having count(*) > 1),
2小时内未重复呼入的量 = (select count(*)
from A
where B.客服id = A.客服id
and 呼叫时间 >= sysdate + 1/24 * 2
group by 电话号码
having count(*) = 1);
否重复呼叫 = (select case when count(*) > 1 then '有重复' else '没有重复' end
from A
where B.客服id = A.客服id
and 呼叫时间 >= sysdate + 1/24 * 2
group by 电话号码
having count(*) > 1);