How to Delete Duplicates in Production Environment | SQL Delete Duplicate Rows

  Рет қаралды 10,866

Ankit Bansal

Ankit Bansal

2 жыл бұрын

In this video we will discuss multiple scenarios of duplicate data. We will see how we can delete duplicates with backup.
Playlist for complex SQL questions:
• Complex SQL Questions ...

Пікірлер: 27
@sonunitjsr223
@sonunitjsr223 Жыл бұрын
Thanks for the great content!. Please add the create/insert statements so that it is easy to do hands on
@vijaypalmanit
@vijaypalmanit 2 жыл бұрын
Oh man ! Superb !
@ankitbansal6
@ankitbansal6 2 жыл бұрын
🙏
@Mysingh9767
@Mysingh9767 2 жыл бұрын
Thanks... Great explanation... Subscribed to your channel..
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thank you 😊
@sreemalapal
@sreemalapal 4 ай бұрын
Very useful video
@sowmiyav4003
@sowmiyav4003 2 жыл бұрын
Hi Ankit, Your videos are really helpful. I am regularly watching your videos and learning SQL. A small request from my side. Could you please mention CREATE TABLE and INSERT VALUES statements in description so that its easy for the viewers to practice.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Hi Sowmiya. I mostly put the create and insert for all the scenario based problems. This was more concept based video. Going forward will put for all the videos. Thanks for watching the videos. It means a lot to me 🙂
@ayankumarbajpai6533
@ayankumarbajpai6533 Жыл бұрын
I'm new to SQL, so is there any way we can do it without backing up or the tables which don't have timestamps? It is really confusing as a beginner
@sagarthapliyal155
@sagarthapliyal155 Жыл бұрын
I have a scenario problem statement to share, How to share and need your support on that problem?
@sagarthapliyal155
@sagarthapliyal155 Жыл бұрын
Sir , What if we have same and different created time?
@aneksingh4496
@aneksingh4496 2 жыл бұрын
We use the row_number and also dense_rank approach in our spark code 😊
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Cool
@subhojitchatterjee2761
@subhojitchatterjee2761 Жыл бұрын
In cases of pure duplicate we can use just group by over all the columns in the table .
@sudarshanthota4444
@sudarshanthota4444 2 жыл бұрын
Thanks bro 🥰🥰🥰
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Welcome 🤗
@PriyaYadav-jh5wj
@PriyaYadav-jh5wj 2 жыл бұрын
For the pair of columns to work, we can concat both and use the result.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Thanks. This is a cool trick.
@sherifelgazar4089
@sherifelgazar4089 Жыл бұрын
can we have the dataset to apply with you
@rajkumarrajan8059
@rajkumarrajan8059 7 ай бұрын
Msg 4104, Level 16, State 1, Line 77 The multi-part identifier "T.ORDER_ID" could not be bound. Msg 4104, Level 16, State 1, Line 77 The multi-part identifier "T.CREATE_TIME" could not be bound. DELETE T FROM TRANSACTIONS INNER JOIN ( SELECT ORDER_ID ,MIN(CREATE_TIME) AS [CREATE_TIME] FROM TRANSACTIONS GROUP BY ORDER_ID HAVING COUNT(1) >1 ) A ON T.ORDER_ID=A.ORDER_ID AND T.CREATE_TIME=A.CREATE_TIME For the Query i am getting the above error
@abhikworld
@abhikworld 2 жыл бұрын
Hey Ankit , Can you make videos on Indexing, normalization , views and their use cases. You can also create your telegram channel so that more people will join and can discuss sql queries.
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Sure
@florincopaci6821
@florincopaci6821 2 жыл бұрын
Hello Sir ! Thank you once again for other useful video! Many Thanks! I have a big request(maybe someone reed my comment and help me) please-i don t have a LeetCode subscription and i have left to solve only 2 question regarding SQL-2153-The number of passengers in each bus || and the last question 2175-The Change in Global Rankings Please can you help me only with the data from this 2 question and the requests-i don t need the solution. I can not find on internet the data from this 2 question. I will let here my solution-maybe is useful for someone at the question2142-The number of passengers in each bus | - with bus as ( select bus_id, arrival_time, row_number()over(order by arrival_time) as tip from buses ) select b.bus_id, count(p.pasager_id) as how_many from bus b left join passengers p on p.arrival_id between b.tip and b.arrival_time group by b.bus_id order by 1 All the best!
@ankitbansal6
@ankitbansal6 2 жыл бұрын
Check LinkedIn chat.
@florincopaci6821
@florincopaci6821 2 жыл бұрын
@@ankitbansal6 I will.Thank you!
@smitnema9760
@smitnema9760 11 ай бұрын
@ankit bansal sir what if my data is something like this and i cannot use cte because i am not using sql servere id name salary dept_id -- ---- ------ ------- E1 XYZ 80000 1 E1 XYZ 80000 1 E1 XYZ 80000 1 E2 PQR 82000 5
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 133 МЛН
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 9 МЛН
Oracle PL SQL interview question | SQL to Delete duplicate records
17:27
DELETE DUPLICATE ROWS FROM A TABLE IN SQL || 4 ways
9:15
Crack Concepts
Рет қаралды 202 М.
All About SQL Aggregations | SQL Advance | Zero to Hero
17:43
Ankit Bansal
Рет қаралды 49 М.
ИГРОВОВЫЙ НОУТ ASUS ЗА 57 тысяч
25:33
Ремонтяш
Рет қаралды 348 М.
После ввода кода - протирайте панель
0:18
Up Your Brains
Рет қаралды 1,2 МЛН
В России ускорили интернет в 1000 раз
0:18
Короче, новости
Рет қаралды 1,8 МЛН
Mastering Picture Editing: Zoom Tools Tutorial
0:52
Photoo Edit
Рет қаралды 504 М.
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 2,3 МЛН