← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 18119: Script

 

------------------------------------------------------------
revno: 18119
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2015-01-24 11:59:12 +0100
message:
  Script
modified:
  resources/sql/integritychecks.sql


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'resources/sql/integritychecks.sql'
--- resources/sql/integritychecks.sql	2015-01-12 19:02:27 +0000
+++ resources/sql/integritychecks.sql	2015-01-24 10:59:12 +0000
@@ -162,6 +162,14 @@
 
 select categoryid, categoryoptionid, count(*) from categories_categoryoptions group by categoryid, categoryoptionid having count(*) > 1;
 
+-- Get category combos with categories which share the same category options
+
+select cc.name as cc_name, co.name as co_name from categorycombo cc 
+inner join categorycombos_categories ccc on cc.categorycomboid=ccc.categorycomboid
+inner join categories_categoryoptions cco on ccc.categoryid=cco.categoryid
+inner join dataelementcategoryoption co on cco.categoryoptionid=co.categoryoptionid
+group by cc_name, co_name having count(*) > 1;
+
 -- Get categories with more than one membership for a category combination
 
 select categorycomboid, categoryid, count(*) from categorycombos_categories group by categorycomboid, categoryid having count(*) > 1;