I have several columns in table BASE
that have values of 1, 2, and 3.
Instead of a query returning with these boolean/integer values, I’d like the query to return with No, Yes, and N/A, respectively.
I actually have another table CODE
containing these values:
ID | Value |
---|---|
1 | No |
2 | Yes |
3 | N/A |
but I have around 20 columns in the BASE
table so I don’t want to use multiple JOIN
statements to connect the ID column to the several columns in my BASE
table. I think it would be the same with CASE
statements.
Is there I way to write my query where I can mass replace these 1, 2, or 3 values with their respective textual equivalents? Like where I can declare these columns with the integer values and just mass replace their values?
I’m not trying to replace the actual values in the database, just the results from my SQL query.
Any suggestion would be great.
pbs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.