Question : wm_concat

SELECT DISTINCT p.masterproviderid AS providerid
             , rp.specialtyname
             , ps.specialtyid
             ,          
               (
               SELECT wm_concat(rp.specialtyname) concat_specialtyname , rp.specialtyid
                FROM  rfproviderspecialty rp, providerspecialty ps
                WHERE
                   rp.specialtyid = ps.specialtyid
               GROUP BY rp.specialtyid
               
                ) as sname
               
               
FROM providermaster p, provideraddress pa, providerspecialty ps , rfproviderspecialty rp
WHERE pa.masterproviderid = p.masterproviderid
and pa.masterproviderid = 1148421
                                      AND  p.expireddate IS NULL
                                       AND   rp.specialtyid (+) = PS.SPECIALTYID
                                  AND   p.masterproviderid  = ps.masterproviderid (+)


This is not giving the right answer.

Basically, I would like to select the specialtyname and also to concatenate the specialtyname based on specialtyid in the same query for these specific conditions. Is the above query correct

Is there any other way to concatenate specialty name

Answer : wm_concat

wm_concat is not a documented or supported function.

you can instead create your own aggregrate function (search for stragg)

or use  the builtin in COLLECTION function and a custom function to build a string from the resulting collection

or use other methods such as xmlaggregation

all of the above methods are described here...

http://www.experts-exchange.com/Q_24914739.html
Random Solutions  
 
programming4us programming4us