SQL How to replace values of select return?

前端 未结 7 1231
无人共我
无人共我 2020-12-04 18:02

In my database (MySQL) table, has a column with 1 and 0 for represent true and false respectively.

But in S

7条回答
  •  一生所求
    2020-12-04 18:13

    You have a number of choices:

    1. Join with a domain table with TRUE, FALSE Boolean value.
    2. Use (as pointed in this answer)

      SELECT CASE WHEN hide = 0 THEN FALSE ELSE TRUE END FROM
      

      Or if Boolean is not supported:

      SELECT CASE WHEN hide = 0 THEN 'false' ELSE 'true' END FROM
      

提交回复
热议问题