Тёмный

How to remove duplicate records from the table  

The Engineer's Desk
Подписаться 26 тыс.
Просмотров 71 тыс.
50% 1

How to remove duplicate records from the table #shorts #sql #coding #sqlqueries #youtubeshorts #programming

Опубликовано:

 

29 апр 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@bharathbaskran
@bharathbaskran 11 дней назад
Why can't we use distinct
@snood101
@snood101 Месяц назад
super nice solution..you just got another subscriber
@ganeshwalunj4290
@ganeshwalunj4290 24 дня назад
Cool solution but we only compared name. If any other field is different for both the accounts , this approach fails.
@aniketkatre4627
@aniketkatre4627 2 месяца назад
So simple query to ignore group by and having clause.. Thanks please keep it up.
@theengineersdesk7930
@theengineersdesk7930 2 месяца назад
Thanks Aniket
@kalaheera2869
@kalaheera2869 14 дней назад
Group by is better than inner join when dealing with big data
@vlog.444
@vlog.444 7 дней назад
That's good teaching very well I'm. Also believe that so that good ..
@theengineersdesk7930
@theengineersdesk7930 6 дней назад
Thanks
@VishwajeetVKale
@VishwajeetVKale Месяц назад
SQL - Structured Query Language❌ SQL - Simplest Query Language✔️
@hareeshkumar3306
@hareeshkumar3306 2 месяца назад
Nice query
@theengineersdesk7930
@theengineersdesk7930 2 месяца назад
Thanks Hareesh
@fazilrahmanz9797
@fazilrahmanz9797 Месяц назад
Good one man keep going..
@theengineersdesk7930
@theengineersdesk7930 Месяц назад
Thanks Fazil
@ajadpatel7976
@ajadpatel7976 20 дней назад
Very nice.
@theengineersdesk7930
@theengineersdesk7930 17 дней назад
Thanks
@mayurbanta
@mayurbanta Месяц назад
Just use Ranking
@Sushant298
@Sushant298 Месяц назад
Nice
@theengineersdesk7930
@theengineersdesk7930 Месяц назад
Thanks
@TheSree9120
@TheSree9120 Месяц назад
When there is no empid then ?
@viralshorts709
@viralshorts709 23 дня назад
Self Join ?
@sdakshin1
@sdakshin1 26 дней назад
you know that multiple Mahesh can work in a company. This example wont fall under dup table.
@gameply347
@gameply347 Месяц назад
Are you deleting the whole instance e1 , how does it know we are deleting that particular row, is it confirming it in where Clause ?
@theengineersdesk7930
@theengineersdesk7930 Месяц назад
You can see the results
@RakeshKumar-yw9jp
@RakeshKumar-yw9jp 17 дней назад
Why are you using e1.empid>e2.empid. could you pls explain
@theengineersdesk7930
@theengineersdesk7930 17 дней назад
I want to remove the higher emploeeid records for the same employee ( if Mohan has two records at 2nd row and 4th row) - it will delete 4th row
@userzzzabc
@userzzzabc Месяц назад
use this delete from emp e where exists ( select 1 from emp where empname=e.empname and empid>e.empid) 1000x times faster than your query
@RajeshB65
@RajeshB65 Месяц назад
how you decided 1000x?
@michaelbacchiocchi8111
@michaelbacchiocchi8111 Месяц назад
Understood, as this simply purges all duplicate rows that are found within the where clause. But I would argue the database operations are quite similar because neither one sorts the data first. It would be interesting to see though if the inherent where exists function performs faster in general.
@RajKumar_92
@RajKumar_92 22 дня назад
If we don't have Emp_id in table ? which column should take to remove duplicate employee name
@theengineersdesk7930
@theengineersdesk7930 14 дней назад
It depends what you consider to say your records duplicate
@sathyans3852
@sathyans3852 5 дней назад
How to delete without using delete query??
@theengineersdesk7930
@theengineersdesk7930 4 дня назад
Use the truncate...but it will delete the entire record
@GATEngeniouring
@GATEngeniouring Месяц назад
What if we use DISTINCT function
@michaelbacchiocchi8111
@michaelbacchiocchi8111 Месяц назад
That will return distinct results in the query, but the data still exists in the table
@GATEngeniouring
@GATEngeniouring Месяц назад
@@michaelbacchiocchi8111 thanks for clearing up the doubt.
@swapnilsonawane7472
@swapnilsonawane7472 2 месяца назад
Can we use CTE?
@theengineersdesk7930
@theengineersdesk7930 2 месяца назад
Yes
@AlamKhan-yt9wd
@AlamKhan-yt9wd 2 месяца назад
Nice
@theengineersdesk7930
@theengineersdesk7930 2 месяца назад
Thanks
Далее
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Top 5 algorithms for interviews
0:47
Просмотров 403 тыс.
Learn JSON in 10 Minutes
12:00
Просмотров 3,1 млн
DELETE DUPLICATE ROWS FROM A TABLE IN SQL || 4 ways
9:15
SQL Index |¦| Indexes in SQL |¦| Database Index
9:57