SELECT users from MySQL database by privileges bitmask?

前端 未结 2 532
花落未央
花落未央 2020-12-30 00:27

I have users table and want to SELECT some rows by bitmask criteria. I\'ll try to explain my problem with small example.

Structure of table users

2条回答
  •  轮回少年
    2020-12-30 00:48

    [...] want to SELECT some fields

    Wrong. You want to select some Rows. Columns are usually called fields.

    You are supposed to read the Documentation: Bit Functions are documented for mysql.

    So you can try:

    Select * from users WHERE (user_privileges & 1) >0

提交回复
热议问题