select phone_no "香港号码",
phone_dl "大陆号码",
decode(sum(call), 1, '是', null) "拒绝外呼",
decode(sum(sms), 2, '是', null) "拒绝短讯",
decode(sum(email), 3, '是', null) "拒绝邮件"
from (select phone_no,
phone_dl,
decode(black_type, 1, 1, null) call,
decode(black_type, 2, 2, null) sms,
decode(black_type, 3, 3, null) email
from dblacksmslist)
group by phone_no, phone_dl;
phone_dl "大陆号码",
decode(sum(call), 1, '是', null) "拒绝外呼",
decode(sum(sms), 2, '是', null) "拒绝短讯",
decode(sum(email), 3, '是', null) "拒绝邮件"
from (select phone_no,
phone_dl,
decode(black_type, 1, 1, null) call,
decode(black_type, 2, 2, null) sms,
decode(black_type, 3, 3, null) email
from dblacksmslist)
group by phone_no, phone_dl;