Link to home
Start Free TrialLog in
Avatar of isames
isames

asked on

SQL Query

Is it possible to also write the following query into a CASE statement?

select arcf_cust_n, ' ', arcf_name
from ihih, arcf
where RSIH_CUST_N = arcf_cust_n and arcf_parent_cust_n = ' '
union
select arcf_parent_cust_n, arcf_cust_n,
(select b.arcf_name as parent_name
from arcf b
where b.arcf_cust_n = childcust.arcf_parent_cust_n) name
from ihih, arcf childcust
where RSIH_CUST_N = arcf_cust_n and arcf_parent_cust_n <> ' '
ASKER CERTIFIED SOLUTION
Avatar of Scott Pletcher
Scott Pletcher
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of isames
isames

ASKER

Can you explain this for me?

Thanks!!!
Avatar of isames

ASKER

Thanks for your help.
Sorry, I've been SWAMPED at work lately.

I just took the columns that got listed in the first query and had them be shown when the arcf_parent_cust_n column is = ' ', and the column values in the second query to be listed if it wasn't.