ابدأ بالتواصل مع الأشخاص وتبادل معارفك المهنية

أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.

متابعة

I have multiple records in a table and do not have any primary key/ unique key. How to delete duplicate records keeping actual records?

user-image
تم إضافة السؤال من قبل Muhammad Hammad Javaid , IT Project Manager , Dubai Islamic Bank
تاريخ النشر: 2013/04/05
مستخدم محذوف‎
من قبل مستخدم محذوف‎

its better to have a unique key at least on one of the tables, but if not you have to:
1- get the results from table 1
2- get results from table 2
3- store both results in a new table and remove the duplicates.
-------------------------------------------------------------------------------------- if not possible: you may try this: "long way" DELETE FROM table_X1 AS T1 WHERE EXISTS ( SELECT 1 FROM table_X2 AS T2 WHERE T2.Fieldname = T1.Fieldname AND T2.Fieldname = T1.Fieldname AND T2.Fieldname = T1.Fieldname AND T2.Fieldname = T1.Fieldname ) ------------------------------ hope it will work with you :)

المزيد من الأسئلة المماثلة