Jump to content


Photo

table insert from second table


  • Please log in to reply
2 replies to this topic

#1 natalieG

natalieG
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 13 June 2006 - 02:51 PM

we have two two tables, PASSWORD and TEST. The only difference between the two is that
TEST has an auto_increment column named [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]PINDEX integer auto_increment[!--colorc--][/span][!--/colorc--]. we want to move all the data from PASSWORD to TEST by the following:

INSERT INTO TEST SELECT * FROM PASSWORD and we get a mysql error=1136.

we then tried:

INSERT INTO TEST SELECT REPFIRM,SUPERVISOR,PASSWORD,EMAIL FROM PASSWORD;
we get another error number and the mysql monitor says" Doesn't match column at row 1.

Is there a way to accomplish this?

Thanks,

Jennifer

#2 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 13 June 2006 - 02:54 PM

Why not just modify the other table structure instead of moving all the data?

Info: PHP Manual


#3 joquius

joquius
  • Members
  • PipPipPip
  • Advanced Member
  • 319 posts

Posted 13 June 2006 - 02:58 PM

in any case you're overlapping the structure you can't insert a row without pindex.
z..z..z..z..z..z..z..z..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users