make sure are created other wise create your table and add some data. for example : then run this query: SELECT first_name, last_name, ( CASE WHEN user_id < 3 THEN "Admin user" WHEN user_id = 3 THEN "editor user" ELSE "suscriber user" END) as role FROM users; the result output is : you can define query as per your requirement.