I'm still skeptical this will solve the problem, but here's one way to do
what you asked:
ALTER TABLE news_table
DROP id,
ORDER BY timestamp_column;
That will drop the id column and reorder the table according to the values
in timestamp_column. (If there have been no deletions, aren't the
temporary_table;
drop table temp_table;
== Original message follows ==
Date: Sat, 6 Nov 2004 15:18:50 +0100 (MET)
From: "Martin" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
MIME-Version: 1.0
Subject: Re: Reorder a table
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/pl
> He means that his primary key column has rows with id=1 and
> id=3, but not with id=2.
Thanks, this is exactly the problem. I did not blame mysql for anything - I
like it a lot. I blamed the news application, to which I referred as "the
application". I did not develop the application/ don't ha
;
To: "Rhino" <[EMAIL PROTECTED]>
Cc: "Martin" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, November 06, 2004 7:55 AM
Subject: Re: Reorder a table
>
>
> He means that his primary key column has rows with id=1 and id=3, but not
> with id=
He means that his primary key column has rows with id=1 and id=3, but not
with id=2. That is, deletions have left holes in the sequence. He
theorizes that renumbering will help. I agree with you that it won't.
Michael
Rhino wrote:
- Original Message -
From: "Martin" <[EMAIL PROTECTED
- Original Message -
From: "Martin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 06, 2004 6:49 AM
Subject: Reorder a table
> Hi all,
>
> I have a problem with a news application, which writes news items into a
> mysql table.
Hi all,
I have a problem with a news application, which writes news items into a
mysql table. Recently it gets confused, when it inserts new news items into
the table. I get the following exception:
"Duplicate entry '25' for key 1". root cause was java.sql.SQLException:
Invalid argument value, me