Microsoft
Software
Hardware
Network
Question : How to avoid duplicate record in Mysql
I have two questions:
1- My table has duplicate records eg. same symbol,date,time but value is different. How can I
delete these duplicate records?
2- How can I modify my table so that whenever I insert a record (index selected based on
symbol,date,time), the MySQL will reject those have the same index (combination of
symbol,date,and time)?
Thx,
XT
Answer : How to avoid duplicate record in Mysql
You need an unique index. You can do this in one operation:
alter ignore table TableName add unique index IndexName (`symbol`,`date`,`time`);
This will delete duplicates and create an unique index, preventing future inserts of duplicate rows.
Random Solutions
How to image server with multiple disks/partitions with Ghost?
How do i permanently remove searchexe?
Mysterious gray bar on the top of every page in word
Joomla
Cannot login to the local console of a server
IIS7 and DNS on Server 2008
Searching Content of PDF Files On Our Linux Based Intranet Web Site
Read Stored procedure text from java code.
vbscript, domain authentication for non-domain computer
Screen Freeze