Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql delete duplicate rows but keep one

DELETE c1 FROM contacts c1
INNER JOIN contacts c2 
WHERE
    c1.id > c2.id AND 
    c1.email = c2.email;
Comment

how to delete duplicate entries in a column in mysql

# Please write a DELETE statement and DO NOT write a SELECT statement.
# Write your MySQL query statement below
DELETE c1 FROM Person c1
INNER JOIN Person c2 
WHERE
    c1.id > c2.id AND 
    c1.email = c2.email;

#delete duplicate emails from table Person
Comment

Remove duplicate old value in mysql

DELETE `yellow_page_content`
   from `yellow_page_content`
  inner join (
     select max(`id`) as lastId, `code`
       from `yellow_page_content`
      group by `code`
     having count(*) > 1) duplic on duplic.code = yellow_page_content.code
  where yellow_page_content.id < duplic.lastId;
Comment

mysql delete duplicate rows except one

DELETE FROM NAMES
 WHERE id NOT IN (SELECT * 
                    FROM (SELECT MIN(n.id)
                            FROM NAMES n
                        GROUP BY n.name) x)
Comment

identify rows with 2 same column value and delete duplicate mysql

DELETE c1 FROM contacts c1
INNER JOIN contacts c2 
WHERE
    c1.id > c2.id AND 
    c1.email = c2.email;
Code language: SQL (Structured Query Language) (sql)
Comment

PREVIOUS NEXT
Code Example
Sql :: not equal in mysql query 
Sql :: take sql dump in to file 
Sql :: how to find columns with null values in sql 
Sql :: grapgql 
Sql :: postgres trim string 
Sql :: mysql select smaller of two values 
Sql :: what is between keyword used for 
Sql :: sql constraint to check date less than current date 
Sql :: less than and between in sql query 
Sql :: insert into table sql 
Sql :: insert into from 
Sql :: how to install mssql on mac 
Sql :: normalization in sql 
Sql :: drop table oracle 
Sql :: sql developer connect to sql server 
Sql :: postgresql connect 
Sql :: postgresql install with ansible 
Sql :: SQL Addition Operator 
Sql :: install mssql on ubuntu 
Sql :: min and max salary and name in sql 
Sql :: sql datetime functions 
Sql :: SQL MIN() Function 
Sql :: test connection to sql server 
Sql :: ORA-06502: PL/SQL: numeric or value error: character string buffer too small 
Sql :: postgresql comandos basicos 
Sql :: postgres duplicate database in same server while other session is using source database 
Sql :: ring MySQL get a list of columns names 
Sql :: delete from table and truncate table 
Sql :: sql shell psql cannot enter password 
Sql :: where in clause tsql 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =