Jump to content

Archived

This topic is now archived and is closed to further replies.

rwwd

silly question

Recommended Posts

Hello all.

 

Silly question i know, but i want to move data from one table field to another, is this possible and if so what is the syntax??

 

I imagine it would be along the lines of - MOVE values one FROM colum_1 to colum_2 LIMIT 1, so in theory i have moved one from colum_1 one to colum_2.

 

I hope that im in the right ballpark!!

 

Cheers for the continued help.

 

Rwwd

Share this post


Link to post
Share on other sites

something like this, i think; check the manual:

 

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--]inset into table1 values [span style=\'color:blue;font-weight:bold\']select[/span] * from table2 [!--sql2--][/div][!--sql3--]

Share this post


Link to post
Share on other sites

Insert all of table2 to table1

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']INSERT[/span] INTO table1 [span style=\'color:blue;font-weight:bold\']SELECT[/span] * FROM table2 [!--sql2--][/div][!--sql3--]

 

Insert from table2 to table2 with conditions

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']INSERT[/span] INTO table1 [span style=\'color:blue;font-weight:bold\']SELECT[/span] * FROM table2 WHERE blah blah [!--sql2--][/div][!--sql3--]

 

Insert only certain fields from table2 to table1

[!--sql--][div class=\'sqltop\']SQL[/div][div class=\'sqlmain\'][!--sql1--][span style=\'color:blue;font-weight:bold\']INSERT[/span] INTO table1 (field1, field3) [span style=\'color:blue;font-weight:bold\']SELECt[/span] field1, field3 FROM table2 [!--sql2--][/div][!--sql3--]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.