[ale] Renumber keys in mysql

Omar Chanouha ofosho at gatech.edu
Thu Jul 21 11:58:33 EDT 2011


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.
>
>
>


More information about the Ale mailing list