I have table with permissions that has few bit fields. I want to group rows in this table and get result with top permissions. So with this table:
UserId, Perm
As simple as...
MAX(CAST(Permisssion1 AS tinyint))
You don't have many other options...