mysql - Why am I getting " Duplicate entry" errors when inserting the DISTINCT values into a table? -
I am trying to insert specific values of a field from the table However I get this error I do not believe that the table I have a non-unique index on EDIT In the but in the new table, it is defined: request only In the field of the table,
pastmonth
create tab 'pastemoth' (`video_id`) four (5) default faucet, primary key (` video_id`)); Enter Last Month (Video_ID) Select from the difference (video_id) requests from where exec_datetime & gt; = Now () - 60 * 24 * 60 * 60;
error code: 1062. Duplicate entry of 'ABCDE' for key 'primary'
request has duplicate entries for the value
abcde , because the following query indicates that it has only 1 entry but thereby It does not matter if there was because I am choosing different values.
SELECT COUNT (*) requests from WHERE video_id = 'abcde'; COUNT (*) 1
requests.video_id but I think I have an irrelevant to the problem. Is it possible that I have a corrupt BTRE index?
create table 'request' (`request_id` bigint (20) not NULL AUTO_INCREMENT,` video_id` four (5) characters Set Latin 1 Collet Latin 1_ban default tap, `exec_datetime` datetime default tap, primary key (` request_id`), key 'exec_datetime` (`exec_datetime`), engine)
requests table, enter the
video_id fields Type is defined:
`video_id` four (5) character set latin1 COLLATE latin1_bin DEFAULT NUL L,
`video_id` char (5) < P> There can be a difference in character set and corresponding matching. Make sure the same letter is set and matched in both fields.
Comments
Post a Comment