← Back to team overview

dhis2-devs team mailing list archive

How to out put category option name and uid in this sql request

 

Hi Everybody,

I got this request that helps me output date element and their category
sent through the mailling list. Now I need to output the same thing with in
addition the category option name and its uid.
Please, could someone can help?

Sql query :

SELECT  de.dataelementid, de.uid as dataelmt_uid, de.name as
dataelementname, de.shortname as dataelementshortname,
coc.categoryoptioncomboid, cc.name as ccname, coc.name as cocname, coc.uid
as cocuid,
cc.categorycomboid, cc.uid as ccuid, dataelementcategoryoption.name as
opname, dataelementcategoryoption.uid as opuid
FROM dataelement de LEFT JOIN categorycombos_optioncombos coccc on
de.categorycomboid = coccc.categorycomboid
LEFT JOIN categorycombo cc ON coccc.categorycomboid = cc.categorycomboid
LEFT JOIN categoryoptioncombo coc ON coccc.categoryoptioncomboid =
coc.categoryoptioncomboid
ORDER BY de.dataelementid


Thanks.