Тёмный

DELETE DUPLICATE ROWS FROM A TABLE IN SQL || 4 ways 

Crack Concepts
Подписаться 124 тыс.
Просмотров 202 тыс.
50% 1

In today's video, we'll learn how to delete duplicate rows from a table in SQL.
4 following ways are shown:
1) remove duplicate rows using a temporary table
2) remove duplicate rows using auto ID
3) remove duplicate rows using row_number()
4) remove duplicate rows using CTE
Thank you!
✨Work related mails can be sent on:
work.sadiasiddiqui@gmail.com
✨If you appreciate my work and would like to donate to support our channel, you can do so here:
paypal.me/sadia1702

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

 

25 июн 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 182   
@crackconcepts
@crackconcepts 8 месяцев назад
✨Link to my SQL e-book: imojo.in/rkajq9 ✨Link to 'Switch your career easily' e-book: imojo.in/1FL7KaG (Perfect for anyone willing to switch to a completely new field or to a different company in the Tech World)
@karthikd2104
@karthikd2104 3 года назад
Seen so many videos in SQL messed up ...this one really understandable with clear explanation!
@umaannamalai3205
@umaannamalai3205 3 года назад
Thank you for the clear explanations! You made the concepts simple to understand. I’m excited for new videos.
@rajkiranboggala9722
@rajkiranboggala9722 3 года назад
I really appreciate your time and effort in sharing these (even though you are having cold)!! Thank you
@srinivasprasad7765
@srinivasprasad7765 3 года назад
Ya true..👍
@ravindrabisht7372
@ravindrabisht7372 3 года назад
That's called dedication...keep it up dear
@ShubhamKumar-mf4sg
@ShubhamKumar-mf4sg 2 года назад
Having cold ..hahaha..nailed it bro
@tubepankajyou
@tubepankajyou 2 года назад
Such developers actually reach to top positions, appreciate it.
@Rjjithin777
@Rjjithin777 2 года назад
Simply superb, doing a great job, simple and clear
@adapass
@adapass 2 года назад
explanation is very clear by writing in paper which is unique in youtube. great job
@marvinmachitar7229
@marvinmachitar7229 2 года назад
Wow! You are so good teacher. Was able to understand it more than other videos with fancy animation.
@rajattalnikar6167
@rajattalnikar6167 3 года назад
Thankyou so much. You've covered all the methods and discussed them in detail.
@aeriesx4727
@aeriesx4727 3 года назад
Absolutely brilliant explanation... Thank you so much..
@tchelaa6894
@tchelaa6894 6 месяцев назад
I have been stuck on this since yesterday. Thank you😎
@mastanshaik5479
@mastanshaik5479 3 года назад
Nice & simple way of understanding 👏👏 for new starters in sql ur videos are best .. thank you for ur efforts and time
@deepakaggarwal8624
@deepakaggarwal8624 2 года назад
Excellent, your solutions are just great and easy to understand
@MUSKAN0896
@MUSKAN0896 2 года назад
This was very helpful! Thank you so much
@maxiejane
@maxiejane 4 года назад
So helpful thank you for sharing!
@MoodyVideoGraphies
@MoodyVideoGraphies 2 года назад
kitni awesome hai yaar... So well explained... calm and soothing...
@techninja9461
@techninja9461 2 года назад
Excellent Explanation.....This video is really helpful.
@nimmikcherian3242
@nimmikcherian3242 3 года назад
Very detailed description... thanks
@giridandi7480
@giridandi7480 Год назад
Very nice.simple understanding way you explain so nice
@nausheen292
@nausheen292 2 года назад
Very well explained....Thank you 😀
@akashagarwal6390
@akashagarwal6390 4 года назад
Mam it would be great if you can take up topics or concepts which are really important like this though not much frequently asked in interviews and also it is useful for an engineer to know all these as well
@DeepakMeena-kz9bu
@DeepakMeena-kz9bu 3 года назад
over partition example was really helpful
@richardconnolly4295
@richardconnolly4295 3 года назад
SUPER HELPFUL!
@saravananbhojan8750
@saravananbhojan8750 2 года назад
Learned best way to query thanks for the video !!
@akashverma1640
@akashverma1640 2 года назад
Thank you very much for you efforts... Must to be known things👌👌
@Sriramlivz
@Sriramlivz 4 года назад
Nice Explaination. You have a lovely voice
@mudasar8629
@mudasar8629 3 года назад
Thank a lots !!! :) Hope to see more videos from you.
@Aryan-ly5ho
@Aryan-ly5ho 3 года назад
Helped me a lot Thanks 😁
@mangamanasvi5485
@mangamanasvi5485 4 года назад
Good Job!, Thank you.
@joshyjohn9636
@joshyjohn9636 3 года назад
Well explained, It will be most useful video in this topic..
@saurabhbenbanshi3460
@saurabhbenbanshi3460 4 года назад
thanks you explained well...
@jaganjayakumar4874
@jaganjayakumar4874 4 года назад
Clear explanation keep doing more videos👍
@akash_pal
@akash_pal 4 года назад
well Explained !! Thank you.
@bro_7079
@bro_7079 4 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-zA9v9lnP2BE.html
@husler7424
@husler7424 Год назад
Watching in 2022, for placements as being CSE student. Thanks a lot, didi. Your explanation is just amazing.
@zafariqbalunknown9786
@zafariqbalunknown9786 2 года назад
Your efforts helped me a lot Thankyou mam
@AmanKhan-ei4cg
@AmanKhan-ei4cg 4 года назад
Thanks for such stuff🥰
@naveenshagala3136
@naveenshagala3136 5 лет назад
Nice explanation with such a calm voice.
@crackconcepts
@crackconcepts 5 лет назад
Thank you 😃
@sohailkat8867
@sohailkat8867 2 года назад
Nice video, and it would be great if you could make a video on types of Analytical Functions in sql, thanks!
@rakeshgopidi4066
@rakeshgopidi4066 2 года назад
It's a great post Sadia, no matter how many years of experience we have ,it's always a good revision for any one # Additional Reference There are also other ways to restrict the duplicates 1. UNIQUE 2. UNION 3. ROW_NUMBER | RANK () | DENSE_RANK () - Analytical Function 4. INTERSECT 5. MINUS 6. ROWID | ROWID + CORRELATED SUBQUERY 7. GROUP BY
@mohansaivelagapudi929
@mohansaivelagapudi929 2 года назад
Thanks for Helping
@maryamfatima5882
@maryamfatima5882 Год назад
excellent explanation
@meditationandrelaxationmus741
@meditationandrelaxationmus741 2 года назад
Thanks it is very important interview question
@qaz_testzaq_test8138
@qaz_testzaq_test8138 3 года назад
Good work, thanks
@HardikShah17
@HardikShah17 3 года назад
Perfect. Thanks.
@faizazhar768
@faizazhar768 Год назад
SO SIMPLE AND EASY
@ankiturmaliya7286
@ankiturmaliya7286 11 месяцев назад
very good explanation..
@veerulinganagoudar3456
@veerulinganagoudar3456 2 года назад
It's really helpful
@shubhamanand1347
@shubhamanand1347 4 года назад
your videos are awesome please make more videos on different topics
@shubhamchoudhary5461
@shubhamchoudhary5461 3 года назад
So informative...👍
@shwetabudake6144
@shwetabudake6144 2 года назад
Very well explained
@rajendrarajendra583
@rajendrarajendra583 2 года назад
Your explanation is superb. one small request what ever you explained can you explain in sql server . that is very use full to us.
@CarlosRivera-mp7mm
@CarlosRivera-mp7mm Год назад
Excelente muchas gracias
@swapneelkambe2092
@swapneelkambe2092 Год назад
Good explanation
@namratanikam7566
@namratanikam7566 2 года назад
Well explained👍
@boddanapalliavinash6418
@boddanapalliavinash6418 Год назад
Very good explanation keep it up 👍
@ybujji
@ybujji 4 года назад
Thank you so much
@sheikhmohduzair4641
@sheikhmohduzair4641 Год назад
Your contents are amazing
@hadireg
@hadireg 3 года назад
a bit speedy but you're doing a great job!
@praveenvadde278
@praveenvadde278 3 года назад
Good explanation. Can please explain and show by executing in the system.
@sushantpawar5635
@sushantpawar5635 3 года назад
शेंबडाचा त्रास होत असताना देखील खूप छान शिकवलंस🙏👍 thank you
@mrrishiraj88
@mrrishiraj88 3 года назад
Great videos.
@nareshd4199
@nareshd4199 4 года назад
Thank you
@dhineshrajendran2312
@dhineshrajendran2312 3 года назад
Much appreciated
@muraliraj9658
@muraliraj9658 3 года назад
Thank you.
@Pavankumar71036
@Pavankumar71036 3 года назад
Excellent
@vivekrahate2564
@vivekrahate2564 2 года назад
Thank u dear..
@ankittiwari-pw6nr
@ankittiwari-pw6nr 4 года назад
Thanks
@hidden590
@hidden590 3 года назад
First method is easy to understand ...so I will go with the first method
@FitVisionTV
@FitVisionTV 3 года назад
First method will overload database performance. Avoid using select *
@sathyasathyam6930
@sathyasathyam6930 3 года назад
Super thank 🌹you
@digitalcode5685
@digitalcode5685 2 года назад
THANKS
@shivyogi806
@shivyogi806 4 года назад
You have amazing, simple.way of teaching. God bless you and Thank you very much
@joshuasamuel5851
@joshuasamuel5851 4 года назад
Superb
@leesubiramaniyam2704
@leesubiramaniyam2704 2 года назад
Explaining good & may be increase the volume (sound) better good
@bhavanikandikondamatam5926
@bhavanikandikondamatam5926 3 года назад
Hello madam.. I have doubt in using temporary table.. Can insert distinct values in new table Drop the old table Rename new table as old table?
@rk-ej9ep
@rk-ej9ep 2 года назад
Very nice
@ravaliannaldas9320
@ravaliannaldas9320 Год назад
Nyc video sister.
@dstar2211
@dstar2211 4 года назад
superb...good job...
@crackconcepts
@crackconcepts 4 года назад
Thank you!
@simranjeetsingh4101
@simranjeetsingh4101 Год назад
Thanku
@vrocks2210
@vrocks2210 3 года назад
ur voice is so nice😍
@divyasnarayan1803
@divyasnarayan1803 3 года назад
Gr8 wrk!
@yes-pg5dy
@yes-pg5dy 3 года назад
Excellent madam pls do videos on power bi also pls
@ganeshstars1
@ganeshstars1 2 года назад
your explanation is good. I am watching most of the videios. for me 1 st method is showing error missing expression.
@norbycreation1851
@norbycreation1851 Год назад
INSERT INTO temp_table SELECT DISTINCT * FROM old_table;
@music4u1235
@music4u1235 Год назад
so sNice tutorialt like that
@mohammedyousuf1918
@mohammedyousuf1918 Год назад
Super
@ravindrabisht7372
@ravindrabisht7372 3 года назад
Your English is good
@AJGamingMobileLegends
@AJGamingMobileLegends 3 года назад
Thumbs up👍🏻
@MrsBestYT
@MrsBestYT 2 года назад
Good
@mdtaufiquereja3114
@mdtaufiquereja3114 3 года назад
SUPER
@kshathrugan5238
@kshathrugan5238 4 года назад
The first method ,the same query will it work in Oracle sql
@azharuddinluhar9667
@azharuddinluhar9667 2 года назад
3rd and 4th way will delete duplicate row from result set and not from actual table, now what to do for deleting duplicate rows from actual actual?
@YPTechDATIA
@YPTechDATIA 3 года назад
use insert into newtable select distinct * from oldtable; then delete * from oldtable; now insert into oldtable select * from newtable;
@rosonerri-faithful
@rosonerri-faithful 2 года назад
Can we use the MAX(ID) method?
@tushardeepsingh4976
@tushardeepsingh4976 3 года назад
Hi..one question i have ..pls rply ASAP... I'm using MYSQL and MYSQL doesn't support select * into.. therefore i used insert into newtable select distinct * from old table ...here i faced one issue...i hv one tble with eid,ename and salary. eid field is PK and ename and salary has duplicate values ...now when i use insert into using distinct keyword it copies duplicate data as well ......i only want distict data to be copied ..i tried dropping PK but on column eid but i'm facing same issue
@mrf7283
@mrf7283 3 года назад
very good effort and I appreciate your clips. However I have a question; suppose application messed up and gave same ID to two (2) different unique valid name. eg. 5001 to ABC and 5001 to XYZ and we want to keep both that is they should exists in our resultant with 2 unique IDs. Please don't get me wrong I am not trying to trick you, I had this real situation once with thousands of rows and was stuck.
@user-rr9lo4wc8g
@user-rr9lo4wc8g 10 месяцев назад
In that scenario, you need to add ID, name in partition. DELETE FROM ( SELECT *, ROW_NUMBER() OVER (PARTITION BY ID, NAME ORDER BY ID) AS Rno FROM emp ) AS E WHERE Rno > 1; This query will delete duplicate rows from the "emp" table where duplicates are determined by the combination of "ID" and "NAME" columns, keeping only the first occurrence and removing the rest.
@dreambig1668
@dreambig1668 4 года назад
Hi just one suggestion you first way will always not would the solution for routine. N in your second way we have to design table with identify type then you will be able to access
@tushardeepsingh4976
@tushardeepsingh4976 3 года назад
Hii.. Please clear one question in this video ..In CTE inner query ..you have not used * after select keyword ..you have directly written " select row_number()..." .... * aaega na after select ??
@alekhyabodapati5003
@alekhyabodapati5003 3 года назад
where rn>1 is not a good practice use having rn> 1 instead of it. Good video
@Gg-oh2zy
@Gg-oh2zy 4 года назад
nice explanations
@crackconcepts
@crackconcepts 4 года назад
Thank you :)
@Gg-oh2zy
@Gg-oh2zy 4 года назад
@@crackconcepts pls do more videos!!
@saisumanthnagasuri7741
@saisumanthnagasuri7741 Год назад
What happen if there are more than 50 columns with the duplicate records Instead of passing all the columns names to the partition by clause Is there any way to put * . Any thoughts?
@zeus433
@zeus433 3 года назад
Jah bless!
Далее
SQL "difference between" interview questions (part 1)
8:20
Akamakasi dedimi nima dedi🤔
00:25
Просмотров 2,7 млн
Delete Duplicate Rows from SQL Table using 3 ways
12:21
Akamakasi dedimi nima dedi🤔
00:25
Просмотров 2,7 млн