dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #33048
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16822: SQL
------------------------------------------------------------
revno: 16822
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-09-25 20:25:39 +0200
message:
SQL
modified:
resources/sql/div.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/div.sql'
--- resources/sql/div.sql 2014-09-25 15:46:23 +0000
+++ resources/sql/div.sql 2014-09-25 18:25:39 +0000
@@ -92,6 +92,15 @@
join userinfo ui on u.userid=ui.userinfoid
order by u.username;
+-- Users in user role
+
+select u.userid, u.username, ui.firstname, ui.surname from users u
+inner join userinfo ui on u.userid=ui.userinfoid
+inner join userrolemembers urm on u.userid=urm.userid
+inner join userrole ur on urm.userroleid=ur.userroleid
+where ur.name='UserRoleName';
+
+
-- Turn longitude/latitude around for organisationunit coordinates (adjust the like clause)
update organisationunit set coordinates=regexp_replace(coordinates,'\[(.+?\..+?),(.+?\..+?)\]','[\2,\1]')