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

                            主站蜘蛛池模板: 午夜精品久久 | 草久久久 | 日韩伦理电影免费在线观看 | 亚洲成人精选 | 伊人久久成人 | www四虎com| av官网在线 | 自拍偷拍亚洲一区 | www.一区二区三区.com | 天天摸天天看 | 日本一道本视频 | 国产剧情一区 | 欧美精品乱码久久久久久按摩 | 久久久av| 最近最新中文字幕 | 欧美一区二区三区视频 | 日韩在线免费视频 | 免费精品| 一区二区三区四区在线免费观看 | 日韩欧美成人一区二区三区 | 欧美日韩福利 | 免费一区二区三区 | 久久久久久久国产精品 | 精品国产一区久久 | caoporn视频| 国产精品乱码一二三区的特点 | 91av在线视频观看 | 国产aaaaav久久久一区二区 | 日日夜夜av | 国产欧美精品一区二区三区 | 福利片在线 | 国产成人在线一区二区 | 国外成人在线视频网站 | 久久精品二区 | 国产综合av| 日韩成人免费视频 | 亚洲男人天堂 | 国产日韩欧美电影 | 一级黄色片免费 | 亚洲三区视频 | 精品亚洲一区二区三区 |