1,2,3 query

A

A388517

table: users
columns: owner, admin, user
Query: create a fourth column called type when,

admin = 'y' insert a "3"
owner = 'y' insert a "2"
neither owner or admin = 'y' insert a "1"
both owner and admin = 'y' insert a "3"

Thanks folks.
 
A

A388517

Thanks, Gary. I think I'll be needing a bit more help.
What would the correct syntax?

SELECT *
choose(((admin='y',3,owner='y',2,true,1),'1', '2', '3')) as loginType from
listusers
 
G

Gary Walter

SELECT
admin,
owner,
Choose(admin="y","3",owner="y","2",true,"1") as loginType
from
listusers
 
Top