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

  Рет қаралды 204,905

Crack Concepts

Crack Concepts

Күн бұрын

Пікірлер: 182
@crackconcepts
@crackconcepts Жыл бұрын
✨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)
@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.
@karthikd2104
@karthikd2104 3 жыл бұрын
Seen so many videos in SQL messed up ...this one really understandable with clear explanation!
@tchelaa6894
@tchelaa6894 9 ай бұрын
I have been stuck on this since yesterday. Thank you😎
@umaannamalai3205
@umaannamalai3205 3 жыл бұрын
Thank you for the clear explanations! You made the concepts simple to understand. I’m excited for new videos.
@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.
@MoodyVideoGraphies
@MoodyVideoGraphies 2 жыл бұрын
kitni awesome hai yaar... So well explained... calm and soothing...
@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
@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?
@giridandi7480
@giridandi7480 2 жыл бұрын
Very nice.simple understanding way you explain so nice
@rajattalnikar6167
@rajattalnikar6167 3 жыл бұрын
Thankyou so much. You've covered all the methods and discussed them in detail.
@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
@saravananbhojan8750
@saravananbhojan8750 2 жыл бұрын
Learned best way to query thanks for the video !!
@mastanshaik5479
@mastanshaik5479 3 жыл бұрын
Nice & simple way of understanding 👏👏 for new starters in sql ur videos are best .. thank you for ur efforts and time
@Rjjithin777
@Rjjithin777 3 жыл бұрын
Simply superb, doing a great job, simple and clear
@akashverma1640
@akashverma1640 3 жыл бұрын
Thank you very much for you efforts... Must to be known things👌👌
@mohansaivelagapudi929
@mohansaivelagapudi929 2 жыл бұрын
Thanks for Helping
@hidden590
@hidden590 4 жыл бұрын
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 *
@ankiturmaliya7286
@ankiturmaliya7286 Жыл бұрын
very good explanation..
@MUSKAN0896
@MUSKAN0896 2 жыл бұрын
This was very helpful! Thank you so much
@naveenshagala3136
@naveenshagala3136 5 жыл бұрын
Nice explanation with such a calm voice.
@crackconcepts
@crackconcepts 5 жыл бұрын
Thank you 😃
@deepakaggarwal8624
@deepakaggarwal8624 3 жыл бұрын
Excellent, your solutions are just great and easy to understand
@aeriesx4727
@aeriesx4727 3 жыл бұрын
Absolutely brilliant explanation... Thank you so much..
@sushantpawar5635
@sushantpawar5635 3 жыл бұрын
शेंबडाचा त्रास होत असताना देखील खूप छान शिकवलंस🙏👍 thank you
@zafariqbalunknown9786
@zafariqbalunknown9786 2 жыл бұрын
Your efforts helped me a lot Thankyou mam
@swapneelkambe2092
@swapneelkambe2092 2 жыл бұрын
Good explanation
@DeepakMeena-kz9bu
@DeepakMeena-kz9bu 3 жыл бұрын
over partition example was really helpful
@techninja9461
@techninja9461 3 жыл бұрын
Excellent Explanation.....This video is really helpful.
@husler7424
@husler7424 2 жыл бұрын
Watching in 2022, for placements as being CSE student. Thanks a lot, didi. Your explanation is just amazing.
@mudasar8629
@mudasar8629 3 жыл бұрын
Thank a lots !!! :) Hope to see more videos from you.
@nimmikcherian3242
@nimmikcherian3242 3 жыл бұрын
Very detailed description... thanks
@oic_Oracle_integration_cloud
@oic_Oracle_integration_cloud 2 жыл бұрын
SO SIMPLE AND EASY
@joshyjohn9636
@joshyjohn9636 3 жыл бұрын
Well explained, It will be most useful video in this topic..
@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.
@maxiejane
@maxiejane 4 жыл бұрын
So helpful thank you for sharing!
@hadireg
@hadireg 3 жыл бұрын
a bit speedy but you're doing a great job!
@shivyogi806
@shivyogi806 4 жыл бұрын
You have amazing, simple.way of teaching. God bless you and Thank you very much
@meditationandrelaxationmus741
@meditationandrelaxationmus741 3 жыл бұрын
Thanks it is very important interview question
@richardconnolly4295
@richardconnolly4295 3 жыл бұрын
SUPER HELPFUL!
@maryamfatima5882
@maryamfatima5882 2 жыл бұрын
excellent explanation
@nausheen292
@nausheen292 3 жыл бұрын
Very well explained....Thank you 😀
@umeshgolla2730
@umeshgolla2730 5 жыл бұрын
Excellent explaination..
@crackconcepts
@crackconcepts 5 жыл бұрын
Thank you!
@azharuddinluhar9667
@azharuddinluhar9667 3 жыл бұрын
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?
@veerulinganagoudar3456
@veerulinganagoudar3456 2 жыл бұрын
It's really helpful
@boddanapalliavinash6418
@boddanapalliavinash6418 Жыл бұрын
Very good explanation keep it up 👍
@akash_pal
@akash_pal 4 жыл бұрын
well Explained !! Thank you.
@bro_7079
@bro_7079 4 жыл бұрын
kzbin.info/www/bejne/sHKcp2yio7VleKc
@shwetabudake6144
@shwetabudake6144 3 жыл бұрын
Very well explained
@mangamanasvi5485
@mangamanasvi5485 4 жыл бұрын
Good Job!, Thank you.
@CarlosRivera-mp7mm
@CarlosRivera-mp7mm 2 жыл бұрын
Excelente muchas gracias
@sohailkat8867
@sohailkat8867 3 жыл бұрын
Nice video, and it would be great if you could make a video on types of Analytical Functions in sql, thanks!
@vivekrahate2564
@vivekrahate2564 2 жыл бұрын
Thank u dear..
@Aryan-ly5ho
@Aryan-ly5ho 4 жыл бұрын
Helped me a lot Thanks 😁
@Sriramlivz
@Sriramlivz 4 жыл бұрын
Nice Explaination. You have a lovely voice
@saurabhbenbanshi3460
@saurabhbenbanshi3460 4 жыл бұрын
thanks you explained well...
@digitalcode5685
@digitalcode5685 2 жыл бұрын
THANKS
@ganeshstars1
@ganeshstars1 2 жыл бұрын
your explanation is good. I am watching most of the videios. for me 1 st method is showing error missing expression.
@AmanKhan-ei4cg
@AmanKhan-ei4cg 4 жыл бұрын
Thanks for such stuff🥰
@jaganjayakumar4874
@jaganjayakumar4874 4 жыл бұрын
Clear explanation keep doing more videos👍
@leesubiramaniyam2704
@leesubiramaniyam2704 2 жыл бұрын
Explaining good & may be increase the volume (sound) better good
@music4u1235
@music4u1235 2 жыл бұрын
so sNice tutorialt like that
@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.
@MohanGonnabathula
@MohanGonnabathula Жыл бұрын
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.
@shubhamanand1347
@shubhamanand1347 4 жыл бұрын
your videos are awesome please make more videos on different topics
@praveenvadde278
@praveenvadde278 3 жыл бұрын
Good explanation. Can please explain and show by executing in the system.
@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 ??
@HardikShah17
@HardikShah17 4 жыл бұрын
Perfect. Thanks.
@namratanikam7566
@namratanikam7566 3 жыл бұрын
Well explained👍
@shubhamchoudhary5461
@shubhamchoudhary5461 3 жыл бұрын
So informative...👍
@qaz_testzaq_test8138
@qaz_testzaq_test8138 3 жыл бұрын
Good work, thanks
@ravaliannaldas9320
@ravaliannaldas9320 2 жыл бұрын
Nyc video sister.
@muraliraj9658
@muraliraj9658 3 жыл бұрын
Thank you.
@simranjeetsingh4101
@simranjeetsingh4101 Жыл бұрын
Thanku
@mrrishiraj88
@mrrishiraj88 3 жыл бұрын
Great videos.
@ybujji
@ybujji 4 жыл бұрын
Thank you so much
@sathyasathyam6930
@sathyasathyam6930 3 жыл бұрын
Super thank 🌹you
@mannu567
@mannu567 Жыл бұрын
Instead of MIN if we use Max then what will happen? I guess it will also remove duplicate
@norbycreation1851
@norbycreation1851 Жыл бұрын
INSERT INTO temp_table SELECT DISTINCT * FROM old_table;
@rk-ej9ep
@rk-ej9ep 3 жыл бұрын
Very nice
@ankittiwari-pw6nr
@ankittiwari-pw6nr 4 жыл бұрын
Thanks
@rosonerri-faithful
@rosonerri-faithful 2 жыл бұрын
Can we use the MAX(ID) method?
@Pavankumar71036
@Pavankumar71036 3 жыл бұрын
Excellent
@labheshlalka9666
@labheshlalka9666 3 жыл бұрын
Why we can't use direct delete query whose count greater than 1
@mohammedyousuf1918
@mohammedyousuf1918 2 жыл бұрын
Super
@ravindrabisht7372
@ravindrabisht7372 3 жыл бұрын
Your English is good
@dhineshrajendran2312
@dhineshrajendran2312 3 жыл бұрын
Much appreciated
@aditiarjun519
@aditiarjun519 2 ай бұрын
Hello mam, deleting using CTE throws the following error.... "Error Code: 1288. The target table cte of the DELETE is not updatable" how to resolve it?
@divyasnarayan1803
@divyasnarayan1803 3 жыл бұрын
Gr8 wrk!
@dstar2211
@dstar2211 5 жыл бұрын
superb...good job...
@crackconcepts
@crackconcepts 5 жыл бұрын
Thank you!
@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
@yes-pg5dy
@yes-pg5dy 3 жыл бұрын
Excellent madam pls do videos on power bi also pls
@foolchandsonariwal4203
@foolchandsonariwal4203 2 жыл бұрын
Madam derived table delete allow nahi karta he only u can use cte to delete duplicate record.
@MrsBestTube
@MrsBestTube 2 жыл бұрын
Good
@sukritsen9530
@sukritsen9530 5 жыл бұрын
Hello, I have a question, how to delete duplicate records with no unique key in mysql? Can this be done using the row_number function?
@chanduch8973
@chanduch8973 4 жыл бұрын
DELETE K FROM (SELECT *, ROW_NUMBER () OVER (PARTITION BY emp_id ORDER BY emp_id) AS RN FROM MyTable) K WHERE RN>1
@helmiboubaker2742
@helmiboubaker2742 3 жыл бұрын
sorry but the third ways not working for me . this the query that i use delete from (select nom, row_number() over(partition by nom order by nom ) as count_num from fourniseurs)as tab where count_num >1; but the select query work fine i wander why is it not working i use workbench mysql :/
@mobileminimaster3015
@mobileminimaster3015 3 жыл бұрын
delete from fourniseurs where nom IN (select nom from (select nom,row_number() over(partition by nom) as count_num from fourniseurs) ee where ee.count_num>1 );
@joshuasamuel5851
@joshuasamuel5851 4 жыл бұрын
Superb
@88pianissimo90
@88pianissimo90 2 жыл бұрын
I think row_number( ) works slower ... right? If you have millions of records then this will work slow.
@shankar8816
@shankar8816 3 жыл бұрын
Ek different positive way me le gye aap lecture ko.. Wldone
@YPTechDATIA
@YPTechDATIA 4 жыл бұрын
use insert into newtable select distinct * from oldtable; then delete * from oldtable; now insert into oldtable select * from newtable;
@saisumanthnagasuri7741
@saisumanthnagasuri7741 2 жыл бұрын
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?
@swapnilsingh8552
@swapnilsingh8552 2 жыл бұрын
I am using ROW_NUMBER method to delete but it doesn't work...
HOW TO SOLVE QUERIES IN SQL IN INTERVIEWS | QUERY NO 2
5:12
Crack Concepts
Рет қаралды 19 М.
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 13 МЛН
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 11 МЛН
Worst flight ever
00:55
Adam W
Рет қаралды 33 МЛН
SQL "difference between" interview questions (part 1)
8:20
Crack Concepts
Рет қаралды 621 М.
Delete Duplicate Rows from SQL Table using 3 ways
12:21
GetSet SQL
Рет қаралды 22 М.
Oracle SQL Interview Questions : Delete duplicate records in Oracle
5:43
OYUNCAK MİKROFON İLE TRAFİK LAMBASINI DEĞİŞTİRDİ 😱
00:17
Melih Taşçı
Рет қаралды 13 МЛН