Knowledge BaseMetric InsightsDatabase MiscellaneousUpgrade all Regular Users to the Power User role

Upgrade all Regular Users to the Power User role

USE CASE:

  • The provided query will upgrade all Regular Users to Power Users in selected Groups

1. Upgrade Users

UPDATE user
SET is_power_user_ind='Y' 
WHERE user_id IN
(SELECT ugm.user_id
FROM (SELECT * FROM user) AS u
JOIN user_group_member AS ugm ON(u.user_id=ugm.user_id) 
WHERE (u.is_power_user_ind='N' AND u.is_administrator_ind='N') AND ugm.user_group_id IN(<YourTargetedGroupID>)); 

2. Get the group ID for the above query

SELECT ugm.user_group_id, ugm.user_id, u.username 
FROM user_group_member AS ugm
JOIN user AS u ON(u.user_id=ugm.user_id) 
WHERE (u.is_power_user_ind='N' AND u.is_administrator_ind='N')
ORDER BY ugm.user_group_id;