I have the following query:
select a.anumber,
(case
when b.bu_code = 'DIST' and b.req_flag = 'R' then
'TRUE'
else
' '
end) as DIST,
(case
when b.bu_code = 'BCTR' and b.req_flag = 'R' then
'TRUE'
else
' '
end) as BCTR,
(case
when b.bu_code = 'STATE' and b.req_flag = 'R' then
'TRUE'
else
' '
end) as STATE
from account a, account_bu_type b
where a.company_code = b.company_code(+)
and a.number = b.anumber(+)
which gives me results like this:
ANUMBER DIST BCTR STATE
62125 TRUE
62125 TRUE
How do I make the output look like:
ANUMBER DIST BCTR STATE
62125 TRUE TRUE
I tried using a group function but I dont know what aggregation function to use.
Thanks.
select a.anumber,
(case
when b.bu_code = 'DIST' and b.req_flag = 'R' then
'TRUE'
else
' '
end) as DIST,
(case
when b.bu_code = 'BCTR' and b.req_flag = 'R' then
'TRUE'
else
' '
end) as BCTR,
(case
when b.bu_code = 'STATE' and b.req_flag = 'R' then
'TRUE'
else
' '
end) as STATE
from account a, account_bu_type b
where a.company_code = b.company_code(+)
and a.number = b.anumber(+)
which gives me results like this:
ANUMBER DIST BCTR STATE
62125 TRUE
62125 TRUE
How do I make the output look like:
ANUMBER DIST BCTR STATE
62125 TRUE TRUE
I tried using a group function but I dont know what aggregation function to use.
Thanks.