1

I have following two queries

SELECT COUNT(Id), PermissionSetId 
FROM PermissionSetAssignment 
GROUP BY ROLLUP(PermissionSetId) 
ORDER BY PermissionSetId LIMIT 1

And

SELECT COUNT(Id), PermissionSet.Name 
FROM PermissionSetAssignment 
GROUP BY ROLLUP(PermissionSet.Name) 
ORDER BY PermissionSet.Name LIMIT 1

And these are the results in my dev org -

Result #1 enter image description here

Result #2 enter image description here

The only difference in these queries is that 1st is grouped by PermissionSetId and 2nd is by PermissionSet.Name

The issue is self explanatory - Difference in count.

Confirming that all permissionset names are unique. I have spotted the permission set that is causing this, is there something fishy going on that permission?

Also confirming that i don't see this anomaly on all the orgs that i have tested. All the permission set names are also unique

3
  • 1
    why are you using LIMIT 1 for a Group by Rollup?
    – cropredy
    Jul 28 at 19:46
  • I did not wanted to show my entire result set for a concise screenshot. You can try without the LIMIT Jul 29 at 4:41
  • you say you spotted the permission set causing this, what is it? Is it a standard one or a custom one? fwiw, I don't see any difference in my org when running the same queries. Jul 29 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.