<legend id='PSUtU'><style id='PSUtU'><dir id='PSUtU'><q id='PSUtU'></q></dir></style></legend>
  • <small id='PSUtU'></small><noframes id='PSUtU'>

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

        使用 select 向查询结果添加行

        Add row to query result using select(使用 select 向查询结果添加行)
      2. <legend id='VyxY6'><style id='VyxY6'><dir id='VyxY6'><q id='VyxY6'></q></dir></style></legend>

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

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

        <tfoot id='VyxY6'></tfoot>

                <tbody id='VyxY6'></tbody>

                <bdo id='VyxY6'></bdo><ul id='VyxY6'></ul>
                  本文介绍了使用 select 向查询结果添加行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  是否可以使用这样的文字扩展查询结果?

                  Is it possible to extend query results with literals like this?

                  select name from users
                  union
                  select name from ('JASON');
                  

                  select age, name from users
                  union
                  select age, name from (25,'Betty');
                  

                  所以它返回表中的所有名字加上'JASON',或(25,'Betty').

                  so it returns all the names in the table plus 'JASON', or (25,'Betty').

                  推荐答案

                  你可以这样使用:

                  SELECT  age, name
                  FROM    users
                  UNION
                  SELECT  25 AS age, 'Betty' AS name
                  

                  使用 UNION ALL 允许重复:如果您的用户中有 25 岁的 Betty,则第二个查询将不会仅使用 UNION 再次选择她.

                  Use UNION ALL to allow duplicates: if there is a 25-years old Betty among your users, the second query will not select her again with mere UNION.

                  这篇关于使用 select 向查询结果添加行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)
                    <i id='ShSZz'><tr id='ShSZz'><dt id='ShSZz'><q id='ShSZz'><span id='ShSZz'><b id='ShSZz'><form id='ShSZz'><ins id='ShSZz'></ins><ul id='ShSZz'></ul><sub id='ShSZz'></sub></form><legend id='ShSZz'></legend><bdo id='ShSZz'><pre id='ShSZz'><center id='ShSZz'></center></pre></bdo></b><th id='ShSZz'></th></span></q></dt></tr></i><div id='ShSZz'><tfoot id='ShSZz'></tfoot><dl id='ShSZz'><fieldset id='ShSZz'></fieldset></dl></div>

                          <bdo id='ShSZz'></bdo><ul id='ShSZz'></ul>
                            <tbody id='ShSZz'></tbody>
                          • <tfoot id='ShSZz'></tfoot><legend id='ShSZz'><style id='ShSZz'><dir id='ShSZz'><q id='ShSZz'></q></dir></style></legend>

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