<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 如何替换选择返回的值?

        SQL How to replace values of select return?(SQL 如何替换选择返回的值?)
      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 如何替换选择返回的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Building a comma separated list?(建立一个逗号分隔的列表?)
                  Errors in SQL Server while importing CSV file despite varchar(MAX) being used for each column(尽管每列都使用了 varchar(MAX),但在导入 CSV 文件时 SQL Server 中出现错误)
                  How can I import an Excel file into SQL Server?(如何将 Excel 文件导入 SQL Server?)
                  Export table to file with column headers (column names) using the bcp utility and SQL Server 2008(使用 bcp 实用程序和 SQL Server 2008 将表导出到带有列标题(列名称)的文件)
                  Concat field value to string in SQL Server(将字段值连接到 SQL Server 中的字符串)
                  SQL Server Bulk insert of CSV file with inconsistent quotes(SQL Server 批量插入带有不一致引号的 CSV 文件)

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

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

                          <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>