In my database 1 is used to represent true and 0 to represent false. In my column, now i was wondering if anyone can help me write a query that outputs if the value equals to 1 display true if equals to 0 display false?.
Try to use case
select case when col = 1 then 'true'
when col = 0 then 'false'
else 'NN'
end as val
select case when your_bool_column = 1
then 'true'
else 'false'
end as bool_col
from your_table
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With