Results 1 to 3 of 3
Jan 2, 2010, 18:00 #1
How to replace the return value of select?
I know mysql has such function, but I can't find it.
Let's say I have a column of type enum and it stores one of 3 possible values:
'A', 'D', or 'U'
What I want to do is the result of select to return either A or D or NULL instead of U
basically this is an accecc control value -A for allow, D for deny and U for undefined. But I want the undefined to be returned as null
Let's call my column 'access_control'
so how should I write a select access_control from USER_GROUP?
I hope someone knows exactly how to do this.
Jan 2, 2010, 18:59 #2
- Join Date
- Sep 2005
- Sydney, NSW, Australia
- 19 Post(s)
- 1 Thread(s)
Jan 2, 2010, 19:57 #3
OK, CASE!. Thank you.
I was going to use REGEX.