久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='T8tyR'></small><noframes id='T8tyR'>

  • <tfoot id='T8tyR'></tfoot>
      <bdo id='T8tyR'></bdo><ul id='T8tyR'></ul>

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

        <legend id='T8tyR'><style id='T8tyR'><dir id='T8tyR'><q id='T8tyR'></q></dir></style></legend>

        刪除 MySQL 中的重復行

        Remove duplicate rows in MySQL(刪除 MySQL 中的重復行)

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

        2. <small id='xXKW3'></small><noframes id='xXKW3'>

            <tbody id='xXKW3'></tbody>
        3. <legend id='xXKW3'><style id='xXKW3'><dir id='xXKW3'><q id='xXKW3'></q></dir></style></legend>
              <bdo id='xXKW3'></bdo><ul id='xXKW3'></ul>
            • <tfoot id='xXKW3'></tfoot>
                  本文介紹了刪除 MySQL 中的重復行的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個包含以下字段的表格:

                  I have a table with the following fields:

                  id (Unique)
                  url (Unique)
                  title
                  company
                  site_id
                  

                  現在,我需要刪除具有相同 title、company 和 site_id 的行.一種方法是使用以下 SQL 和腳本 (PHP):

                  Now, I need to remove rows having same title, company and site_id. One way to do it will be using the following SQL along with a script (PHP):

                  SELECT title, site_id, location, id, count( * ) 
                  FROM jobs
                  GROUP BY site_id, company, title, location
                  HAVING count( * ) >1
                  

                  運行此查詢后,我可以使用服務器端腳本刪除重復項.

                  After running this query, I can remove duplicates using a server side script.

                  但是,我想知道這是否可以僅使用 SQL 查詢來完成.

                  But, I want to know if this can be done only using SQL query.

                  推薦答案

                  一個非常簡單的方法是在 3 列上添加一個 UNIQUE 索引.在編寫 ALTER 語句時,請包含 IGNORE 關鍵字.像這樣:

                  A really easy way to do this is to add a UNIQUE index on the 3 columns. When you write the ALTER statement, include the IGNORE keyword. Like so:

                  ALTER IGNORE TABLE jobs
                  ADD UNIQUE INDEX idx_name (site_id, title, company);
                  

                  這將刪除所有重復的行.作為額外的好處,以后重復的 INSERT 會出錯.與往常一樣,您可能希望在運行類似操作之前進行備份...

                  This will drop all the duplicate rows. As an added benefit, future INSERTs that are duplicates will error out. As always, you may want to take a backup before running something like this...

                  這篇關于刪除 MySQL 中的重復行的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to use windowing functions efficiently to decide next N number of rows based on N number of previous values(如何有效地使用窗口函數根據 N 個先前值來決定接下來的 N 個行)
                  reuse the result of a select expression in the quot;GROUP BYquot; clause?(在“GROUP BY中重用選擇表達式的結果;條款?)
                  Does ignore option of Pyspark DataFrameWriter jdbc function ignore entire transaction or just offending rows?(Pyspark DataFrameWriter jdbc 函數的 ignore 選項是忽略整個事務還是只是有問題的行?) - IT屋-程序員軟件開發技
                  Error while using INSERT INTO table ON DUPLICATE KEY, using a for loop array(使用 INSERT INTO table ON DUPLICATE KEY 時出錯,使用 for 循環數組)
                  pyspark mysql jdbc load An error occurred while calling o23.load No suitable driver(pyspark mysql jdbc load 調用 o23.load 時發生錯誤 沒有合適的驅動程序)
                  How to integrate Apache Spark with MySQL for reading database tables as a spark dataframe?(如何將 Apache Spark 與 MySQL 集成以將數據庫表作為 Spark 數據幀讀取?)
                    <bdo id='ylMNd'></bdo><ul id='ylMNd'></ul>

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

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

                        1. <tfoot id='ylMNd'></tfoot>

                            <tbody id='ylMNd'></tbody>

                            主站蜘蛛池模板: 国产欧美一区二区久久性色99 | 午夜天堂精品久久久久 | 成人国产精品免费观看视频 | 黄色一级大片在线免费看产 | 欧美视频1区 | 偷拍自拍第一页 | 国产精品123区 | 亚洲视频在线观看 | 激情欧美一区二区三区 | 日韩欧美一级 | 日本色综合 | 日韩网站在线 | 日韩二三区 | 一级a爱片久久毛片 | 日韩视频在线一区 | 亚洲毛片在线观看 | 91豆花视频 | 91爱啪啪 | 在线午夜 | 欧美日韩在线播放 | 久久av综合 | 亚洲国产欧美在线 | 粉嫩粉嫩芽的虎白女18在线视频 | 成人综合视频在线 | 国产精品中文字幕一区二区三区 | 亚洲国产视频一区二区 | 91精品久久久久久久久 | 国产成人精品999在线观看 | 国产精产国品一二三产区视频 | 午夜精品久久久久久久久久久久 | 国内精品久久久久久 | 天天躁日日躁狠狠很躁 | 久久久久黄 | 日日射影院 | 黄色毛片一级 | 欧美综合一区二区三区 | 日韩在线 | 成人在线观看免费视频 | 久久亚洲美女 | 97国产一区二区精品久久呦 | 免费观看一级视频 |