• <bdo id='9eHpl'></bdo><ul id='9eHpl'></ul>

    <small id='9eHpl'></small><noframes id='9eHpl'>

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

        选择没有重复条目的一行

        Select one row without duplicate entries(选择没有重复条目的一行)
          <tbody id='Kokg6'></tbody>
        • <bdo id='Kokg6'></bdo><ul id='Kokg6'></ul>

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

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

              <tfoot id='Kokg6'></tfoot>
              • <legend id='Kokg6'><style id='Kokg6'><dir id='Kokg6'><q id='Kokg6'></q></dir></style></legend>
                  本文介绍了选择没有重复条目的一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在 mysql 表 info 我有:

                  In mysql table info i have :

                  Id、姓名、城市、日期、状态

                  Id , Name , City , date , status

                  我想从信息"中选择所有名字进行查询

                  I want to select all names from "info" Making the query

                  $query = mysql_query("SELECT name FROM info WHERE status = 1 ORDER BY id") 
                           or die(mysql_error());
                  
                  while ($raw = mysql_fetch_array($query)) 
                  {
                    $name = $raw["name"];
                    echo ''.$name.'<br>';
                  }
                  

                  好吧,结果是它返回了所有条目.我想回显没有重复的所有条目.

                  Well, the result is that it returns all the entries. I want to echo all the entries without duplicates.

                  说:在原始name"下,我们已经插入了 10 次John"这个名字.
                  我只想回声一次.这可能吗?

                  Saying: under raw "name" we have inserted the name "John" 10 times.
                  I want to echo only one time. Is this possible?

                  推荐答案

                  很简单:

                  SELECT DISTINCT name FROM info WHERE status = 1 ORDER BY id
                  

                  SQL 关键字 DISTINCT 可以解决问题.

                  The SQL keyword DISTINCT does the trick.

                  这篇关于选择没有重复条目的一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 查询中包含缺失的月份)

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

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

                        <tbody id='LUH80'></tbody>
                          <bdo id='LUH80'></bdo><ul id='LUH80'></ul>