• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 735
  • Last Modified:

MySQL select * from users where "the nth character of the string within permissions field is 1"

I have a field called perms in the db that has twenty characters. Each character represents a permission.

How can I write a MySQL query that gives me something like:

MySQL select * from users where "the nth character of the string within permissions field is 1"
0
smetterd
Asked:
smetterd
1 Solution
 
smetterdAuthor Commented:
In the future I promise I will put each permission is a separate field... so please don't advise me to do that right now... I can't!
;-)
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
select * from users where substring(permissions, n, 1) = '1'
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now