أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
we have single table with lot of multiple records and we like to remove the data redundancy from the table. the logic is we want to remove one record the previous record from the table by using sql
select distinct f1,f2,....fn from table - will get you distinct record in the table
best use the cursor with the above querry and store the records by inserting in a similar new table by having a primary key on it by iterating the cursor and once it is done, you can delete your old table.
your job is done.
Select Distinct ..............
Select distinct field from table...
First of all implement at least third normal form. Second use SELECT DISTINCT. That's all!
Select distinct Column_Name From Table_Name
your Database must be normalized.
Marwan answer is right as there is only one approach that is fast to achieve this task-
keep data in temp table and delete constraints that are making data redundant from previous table and take data back to previous table.
Yea it's just select distinct
Data normalisation is what you are looking for...
Normalisation is the process of taking data from a problem and reducing it to a set of relations while ensuring data integrity and eliminating data redundancy
1st Normal Form:
2nd Normal Form:
3rd Normal Form: