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

                            主站蜘蛛池模板: 水蜜桃久久夜色精品一区 | 天堂av资源 | 九九热精品视频 | 欧美日韩高清 | 亚洲 日本 欧美 中文幕 | 韩日一区二区三区 | 亚洲综合精品 | 日韩av美女电影 | 欧美激情综合网 | 亚洲精品在线播放 | 在线一区视频 | 午夜精品久久 | 亚洲激情综合 | 久久一区二区视频 | 免费人成在线观看网站 | 一区二区三区国产 | 国产精品久久国产精品久久 | 91久久久久久久 | 中文字幕在线一区 | 亚洲欧美日韩国产综合 | 美女天堂在线 | 新91视频网 | 一区二区三区四区五区在线视频 | 一区二区三区视频在线观看 | 久久伊人一区二区 | 这里有精品 | 亚洲一区二区三区免费视频 | 看羞羞视频免费 | jav成人av免费播放 | 台湾av在线| 欧美午夜激情在线 | 国产精品视频免费看 | 看av在线 | 综合久久久 | 亚洲男女视频在线观看 | 日本韩国电影免费观看 | 每日更新av | 91免费高清视频 | 日韩中文字幕在线观看视频 | 欧美精品首页 | 国产精品一区视频 |