<tfoot id='s8FPP'></tfoot>

    <i id='s8FPP'><tr id='s8FPP'><dt id='s8FPP'><q id='s8FPP'><span id='s8FPP'><b id='s8FPP'><form id='s8FPP'><ins id='s8FPP'></ins><ul id='s8FPP'></ul><sub id='s8FPP'></sub></form><legend id='s8FPP'></legend><bdo id='s8FPP'><pre id='s8FPP'><center id='s8FPP'></center></pre></bdo></b><th id='s8FPP'></th></span></q></dt></tr></i><div id='s8FPP'><tfoot id='s8FPP'></tfoot><dl id='s8FPP'><fieldset id='s8FPP'></fieldset></dl></div>

        <bdo id='s8FPP'></bdo><ul id='s8FPP'></ul>

    1. <legend id='s8FPP'><style id='s8FPP'><dir id='s8FPP'><q id='s8FPP'></q></dir></style></legend>

      <small id='s8FPP'></small><noframes id='s8FPP'>

        SQL 如何替换选择返回的值?

        时间:2023-10-08
      1. <small id='AFK8h'></small><noframes id='AFK8h'>

          <i id='AFK8h'><tr id='AFK8h'><dt id='AFK8h'><q id='AFK8h'><span id='AFK8h'><b id='AFK8h'><form id='AFK8h'><ins id='AFK8h'></ins><ul id='AFK8h'></ul><sub id='AFK8h'></sub></form><legend id='AFK8h'></legend><bdo id='AFK8h'><pre id='AFK8h'><center id='AFK8h'></center></pre></bdo></b><th id='AFK8h'></th></span></q></dt></tr></i><div id='AFK8h'><tfoot id='AFK8h'></tfoot><dl id='AFK8h'><fieldset id='AFK8h'></fieldset></dl></div>
          <legend id='AFK8h'><style id='AFK8h'><dir id='AFK8h'><q id='AFK8h'></q></dir></style></legend>

                <tbody id='AFK8h'></tbody>
              <tfoot id='AFK8h'></tfoot>
              • <bdo id='AFK8h'></bdo><ul id='AFK8h'></ul>

                1. 本文介绍了SQL 如何替换选择返回的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的数据库 (MySQL) 表中,有一列 10 代表 truefalse> 分别.

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

                  但是在 SELECT 中,我需要它替换 truefalse 以便在 GridView 中打印.

                  But in SELECT, I need it replace for true or false for printing in a GridView.

                  如何使用 SELECT 查询来执行此操作?

                  How to I make my SELECT query to do this?

                  在我当前的表格中:

                   id   |  name    |  hide
                    1   |  Paul    |  1
                    2   |  John    |  0
                    3   |  Jessica |  1
                  

                  我需要它显示:

                    id  |  name    |  hide
                    1   |  Paul    |  true
                    2   |  John    |  false
                    3   |  Jessica |  true
                  

                  推荐答案

                  您有多种选择:

                  1. 加入具有 TRUEFALSE Boolean 值的域表.
                  2. 使用(本答案中指出的)

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

                  或者如果 Boolean 不受支持:

                  Or if Boolean is not supported:

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

                  这篇关于SQL 如何替换选择返回的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:从 NOW() -1 天中选择记录 下一篇:ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和

                  相关文章

                    <small id='WXhZI'></small><noframes id='WXhZI'>

                  1. <legend id='WXhZI'><style id='WXhZI'><dir id='WXhZI'><q id='WXhZI'></q></dir></style></legend>
                      • <bdo id='WXhZI'></bdo><ul id='WXhZI'></ul>
                      <i id='WXhZI'><tr id='WXhZI'><dt id='WXhZI'><q id='WXhZI'><span id='WXhZI'><b id='WXhZI'><form id='WXhZI'><ins id='WXhZI'></ins><ul id='WXhZI'></ul><sub id='WXhZI'></sub></form><legend id='WXhZI'></legend><bdo id='WXhZI'><pre id='WXhZI'><center id='WXhZI'></center></pre></bdo></b><th id='WXhZI'></th></span></q></dt></tr></i><div id='WXhZI'><tfoot id='WXhZI'></tfoot><dl id='WXhZI'><fieldset id='WXhZI'></fieldset></dl></div>
                      <tfoot id='WXhZI'></tfoot>