Answer Posted / prakash.matte
If we have table 'temp' with columns: id(primary key),
field1, field2, field3, to remove the duplicate (field1,
field2, field3) data we can use either of the below queries
1. delete t1.* from temp t1, temp t2
where t1.id>t2.id and t1.field1=t2.field1 and
t1.field2=t2.field2 and t1.field3=t2.field3;
2. alter ignore table temp ADD UNIQUE INDEX
duprows(field1,field2,field3);
> here we can remove the duprows index by using the
following query:
alter table temp drop index duprows;
we can apply index on the columns as we don't require the
duplicate data, so we don't need to execute the query to
delete the index
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Write down the code for saving an uploaded file in PHP.
What is the phpstorm?
How is it possible to propagate a session id?
Tell me what is the actually used php version?
What is new static in php?
What is php full form?
What is difference between base_url and site_url?
Do you know what is the difference between the include() and require() functions?
What is the use session in php?
Explain what is the difference between mysql_fetch_array() and mysql_fetch_assoc()?
How would you determine the size of a file in php?
How do you use end in python?
The left association operator % is used in PHP for?
What is php variable?
how to open & closing opening period in fico