Jump to content

Unwanted Row Entry Duplication


Recommended Posts

QUESTION ONE:  How does  one suppress duplicate row entries?
QUESTION TWO:  In the following case what is causing them to occur?

BACKGROUND:  I created several tables only to discover that they were not as I wanted them.  AFter truncateng each, I dropped what I  believed to be poorly structured columns, rearranged some, and added still others.  When I tested the result, everything worked great except for one problem  --  a single table entry reuslted in duplicate rows.

THE TABLE STRUCTURE

CREATE TABLE 'table_name' (obs` int(5) NOT NULL AUTO_INCREMENT
	.
	.
	.
	PRIMARY KEY (`obs`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1

A SAMPLE SQL STATEMENT

INSERT INTO rss2_podcast_itunes (podcast_no_itunes, itunes_category1, itunes_category2, itunes_category3, itunes_complete, itunes_new_feed_url, itunes_name, itunes_email, itunes_duration, itunes_order, itunes_author, itunes_block, itunes_image, itunes_explicit, itunes_summary) VALUES ('54', 'education', 'language', 'English', '', '', 'Roddy A. Stegemann', 'kiusau@me.com', '00:01:01', '', 'Roddy A. Stegemann', '', 'http://www.grammarcaptive.com/_images/captive.png', '', 'Test')

Please note the following:

  1. No value is entered for the obs field/column.
  2. The auto increment advances one for each row entered.
  3. Below each successfully loaded row entry appears another row identical in every way but one -- the appearance of an incremental advance in the value of the obs field.

Please advise.

Roddy

 

Link to post
Share on other sites

Please ignore the missing back-tick before the obs column.  it was a typo incurred while editing code taken from the results of a SHOW CREATE TABLE statement.

Link to post
Share on other sites

This problem has been resolved.

After a night's rest I discovered that I was accidentally querying the same table twice.  A condition likely caused by an improper copy and paste.

LESSON:  When everything appears correct, do not doubt its correctness.  Look elsewhere for the error.  

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...