Hello all...
I'm have a slight dilemma in SQL. I'm running the below query...
select DISTINCT a.acct,
p.first||' '||p.last OWNER,
p2.first||' '||p2.last OWNER2
from person p, person p2, act a, actperson arp
where a.NBR = p.nbr
and arp.nbr = p2.nbr
and a.acct = arp.acct
ACCT OWNER OWNER2
----- ----------- -----------------
12345 Martin Payne Gina Payne
11223 Vince McMahon Linda McMahon
11223 Vince McMahon Stephanie McMahon
I would like the above output to look like this...
ACCT OWNER OWNER2 OWNER3
----- ----------- ------------- -----------------
12345 Martin Payne Gina Payne
11223 Vince McMahon Linda McMahon Stephanie McMahon
There's really no other way to link to the account owners other than the way I did above. Is there any funky way via SQL for me to pass any second (or third, fourth, etc) into a new output column?
Any help would be greatly appreciated.
Thanks,
Darrel
I'm have a slight dilemma in SQL. I'm running the below query...
select DISTINCT a.acct,
p.first||' '||p.last OWNER,
p2.first||' '||p2.last OWNER2
from person p, person p2, act a, actperson arp
where a.NBR = p.nbr
and arp.nbr = p2.nbr
and a.acct = arp.acct
ACCT OWNER OWNER2
----- ----------- -----------------
12345 Martin Payne Gina Payne
11223 Vince McMahon Linda McMahon
11223 Vince McMahon Stephanie McMahon
I would like the above output to look like this...
ACCT OWNER OWNER2 OWNER3
----- ----------- ------------- -----------------
12345 Martin Payne Gina Payne
11223 Vince McMahon Linda McMahon Stephanie McMahon
There's really no other way to link to the account owners other than the way I did above. Is there any funky way via SQL for me to pass any second (or third, fourth, etc) into a new output column?
Any help would be greatly appreciated.
Thanks,
Darrel