Jump to content


Photo

silly question


  • Please log in to reply
2 replies to this topic

#1 rwwd

rwwd
  • Members
  • PipPipPip
  • Advanced Member
  • 385 posts
  • LocationOn here sometimes

Posted 03 October 2005 - 07:48 PM

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

#2 effigy

effigy
  • Staff Alumni
  • Advanced Member
  • 3,600 posts
  • LocationIL

Posted 03 October 2005 - 08:08 PM

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--]
Regexp | Unicode Article | Letter Database
/\A(e)?((1)?ff(?:(?:ig)?y)?|f(?:ig)?)\z/

#3 ryanlwh

ryanlwh
  • Staff Alumni
  • Advanced Member
  • 511 posts

Posted 04 October 2005 - 05:38 PM

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--]
Please use EDIT * 100...
Please use
or [php] * 1000...

PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users