Gordon Burditt wrote:
>> insert into prizes select * from prizes where prize_id=16;
>> but it gives an error because the prize_id column is autoincrement.
>> this fails as well
>> insert into prizes select * from prizes where prize_id=16 ON DUPLICATE
>> KEY UPDATE prize_id=(select MAX(prize_id)+1 from prizes);
>> strangely changing the prize_id from 16 to 17 rather than inserting
>> 17.
>
> Why is this strange? You've got a duplicate key (prize_id).
>
> How about this, ***uming that your prizes table has fields prize_id,
> nerk, jello, and noodle?
>
> insert into prizes (prize_id, nerk, jello, noodle)
> select null, nerk, jello, noodle from prizes where prize_id = 16;
>
>
Or, just leave the prize_id column out all together:
insert into prizes (nerk, jello, noodle)
select nerk, jello, noodle from prizes where prize_id = 16;
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
EMAIL REMOVED
==================