troubleshooting Question

concaternate connect prior return values

Avatar of chalie001
chalie001 asked on
Oracle Database
9 Comments1 Solution164 ViewsLast Modified:
hi i like to concaternate my return value e.g if an object got more than one parent i what to return all parent for that object in one column,i what to avoid duplicate values
i what values to be like this
    Obj_Name       child_name      Parent_name

    MainObject     ThirdObject    (null)

    SecondObject   FourthObject    MainObject

    FourthObject   ThirdObject     SecondObject

    ThirdObject    ThirdObject     SecondObject,MainObject
my sql is
select obj_name, obj_child, obj_parent, child_id, obj_id,  parent_id
 select c.obj_name,
          oc.obj_name obj_child, 
        op.obj_name obj_parent,
        ec.obj_child child_id,
        c.cal_objid obj_id,
        ep.obj_parent parent_id
   from object_list c,  
   cal_erd ec,
   object_list oc,
   cal_erd ep ,
   object_list op
   where ec.obj_parent(+) = c.cal_objid  -- if object is no parent still get an empty row
   and   ec.obj_child  = oc.cal_objid(+) -- if no child relation found stil get an empty row to get empty child-data 
   and   ep.obj_child(+)  = c.cal_objid  -- if object is not a child still get an empty row
   and   ep.obj_parent = op.cal_objid(+) -- if no parent relation found stil get an empty row to get empty parent-data

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 9 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 9 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros