mirons Posted June 22, 2015 Share Posted June 22, 2015 HiI am querying a table that has values represented by numbers. e.g. Gender is stored as 0 for Female or 1 for Male. I would like to display the results as 'Male' or 'Female' instead of '1' or '0'. Can I do this in my query? There is no reference table.Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted June 22, 2015 Share Posted June 22, 2015 If you're using MySQL, then there is a case operator. Other databases might have something similar.https://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html#operator_case Link to comment Share on other sites More sharing options...
mirons Posted June 24, 2015 Author Share Posted June 24, 2015 Thanks. Worked a treat. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now