[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Renumber keys in mysql
- Subject: [ale] Renumber keys in mysql
- From: cfowler at outpostsentinel.com (Chris Fowler)
- Date: Thu, 21 Jul 2011 11:51:22 -0400
- In-reply-to: <CABQUKrY-uwsbF5rPAsOfr128-qytv2g9TJ=dS2OqZ2E0G-61=Q@mail.gmail.com>
- References: <1311261796.13700.248.camel@compaq-desktop> <CAOy4VzeVD6DiVDsa9dq02qiJ2eKwQ05Cmb9sTEGGiB10rOAFqw@mail.gmail.com> <CABQUKrY-uwsbF5rPAsOfr128-qytv2g9TJ=dS2OqZ2E0G-61=Q@mail.gmail.com>
On Thu, 2011-07-21 at 11:48 -0400, Omar Chanouha wrote:
> If that works, then why create temp at all? Just nest the select in the line:
>
> insert into original (name,...) select name,... from (select * from
> original where id > 50 and id < 150);
>
> http://dev.mysql.com/doc/refman/5.5/en/insert-select.html
>
> That page may help. I think comment one is along the lines of your situation.
Name is unique and mysql will not allow duplicate names.