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
Check Changes Done on Specific Date
Outlook 2007/2003 does not connect.
Oracle to_date Function
Can I complete a database row on insertion?
VBA Email via Access and Outlook EXPRESS MailItem Object???
Exchange 2007 HT / CA server high availability issue
Retrieve accidentally deleted file folder with data in safe mode in Win XP
NLB with 2 Windows 2003 Server Virtual Machines (VM) (500 points)
CVS question - getting all changes of one user between two points in time
ISAM