Jump to content

silly question


rwwd

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

Link to comment
https://forums.phpfreaks.com/topic/2603-silly-question/
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--]

Link to comment
https://forums.phpfreaks.com/topic/2603-silly-question/#findComment-8647
Share on other sites

Archived

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

×
×
  • Create New...

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.