Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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