SQL to remove accounts from groups?
                    SQL to remove accounts from groups?                
                            Comments
- 
            
I have moved a copy of our production environment to a test environment, because of this I have groups with accounts that I want to empty. Is there an SQL query that can help with this?
 - 
            
Hello!
This is the query you could use for that purpose:
select * from account_group_join
where account_id != ADMINISTRATOR ACCOUNTIf you turn this into a delete statement, it will delete all group associations except the default admin account of course. Also note that you can filter GROUP_ID to exclude "GROUP" to return more specified associations.
entity_group is the group table to reference if youre looking for group names. You will need to perform a restart for these changes to be effective.
 
Howdy, Stranger!
Categories
- 4.5K All Categories
 - 88 General
 - 13 Training
 - 214 Installation / Setup
 - 1.2K Flows
 - 112 Rules
 - 277 Administration
 - 215 Portal
 - 503 General Q & A
 - 722 Forms
 - 356 Reports
 - 3 Designer Extensions
 - 47 Example Flows
 - 58 CSS Examples
 - 1 Diagram Tile
 - 8 Javascript Controls
 - 190 Pages
 - 5 Process Mining
 - New Features
 - 187 Datastructures
 - 73 Repository
 - 238 Integrations
 - 30 Multi-Tenant
 - 27 SDK
 - 81 Modules
 - 60 Settings
 - 27 Active Directory
 - 12 Version 7
 - 37 Version 8
 - 143 Lunch And Learn Questions