[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Renumber keys in mysql
- Subject: [ale] Renumber keys in mysql
- From: ofosho at gatech.edu (Omar Chanouha)
- Date: Thu, 21 Jul 2011 11:58:33 -0400
- In-reply-to: <1311263482.13700.250.camel@compaq-desktop>
- References: <1311261796.13700.248.camel@compaq-desktop> <CAOy4VzeVD6DiVDsa9dq02qiJ2eKwQ05Cmb9sTEGGiB10rOAFqw@mail.gmail.com> <CABQUKrY-uwsbF5rPAsOfr128-qytv2g9TJ=dS2OqZ2E0G-61=Q@mail.gmail.com> <1311263482.13700.250.camel@compaq-desktop>
insert into original (name) select concat(name,'x') from (select *
from original where id > 50 and id < 150);
On Thu, Jul 21, 2011 at 11:51 AM, Chris Fowler
<cfowler at outpostsentinel.com> wrote:
> 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.
>
>
>