Alternative for MAX operator on bit fields

前端 未结 1 1627
庸人自扰
庸人自扰 2021-02-18 17:42

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         


        
1条回答
  •  礼貌的吻别
    2021-02-18 18:38

    As simple as...

    MAX(CAST(Permisssion1 AS tinyint))
    

    You don't have many other options...

    0 讨论(0)
提交回复
热议问题