Jump to content
Sign in to follow this  
iwato

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

 

Share this post


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.

Share this post


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.  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×