Ask a Question related to MySQL, Design and Development.
-
Don Vaillancourt #1
insert into...select using the same table
How can I do the following in MySQL.
insert into table1 (col1, col2, col3)
select col1, col2, somevalue as col3
from table1
MySQL doesn't allow you to select from the same table you are inserting
into.
Thank You
Don Vaillancourt Guest
-
What's faster - loop for insert or insert...select.
What is faster if I'm moving large numbers of records (anywhere from 10,000 to 300,000 records per archive) from one query to another table? 1)... -
How Do you insert a table in Previous Table
How Do you insert a table in Previous Table that has an image, in a web page -
SELECT and INSERT
Is there a way to do the SELECT and INSERT in a single SQL statement in MS-Access? -
Login - multi table insert for registrant; subsquent login insert page requests into joined 'Selection' Table
Question regards insert and updates in sql server for a simple login script that requires registration the first time and only "email address" upon... -
Insert into <table w/ text column> select distinct ...
Ok, so it makes sense: create table #myTable (myColumn varchar(10), textColumn text) insert into #myTable select distinct someValue, ''... -
Bill Karwin #2
Re: insert into...select using the same table
"Don Vaillancourt" <donv@webimpact.com> wrote in message
news:VBjUf.15449$43.2817@nnrp.ca.mci.com!nnrp1.uun et.ca...One way would be to store the result of the select in a temporary table, and> How can I do the following in MySQL.
>
> insert into table1 (col1, col2, col3)
> select col1, col2, somevalue as col3
> from table1
then copy that back to table1.
Regards,
Bill K.
Bill Karwin Guest
-
Don Vaillancourt #3
Re: insert into...select using the same table
Ok, did some research and got the answer.
It does work on 4.0.14 and higher.
Don Vaillancourt wrote:> How can I do the following in MySQL.
>
> insert into table1 (col1, col2, col3)
> select col1, col2, somevalue as col3
> from table1
>
> MySQL doesn't allow you to select from the same table you are inserting
> into.
>
> Thank YouDon Vaillancourt Guest



Reply With Quote

