SQL troubles... SELECT INTO

shwaipshwaip bluffin' with my muffin Icrontian
edited February 2005 in Internet & Media
I'm working on the SMx Stats page, and I'm trying to back up a table using the following:

"SELECT * INTO Old FROM Current"

It gives me the error:
"ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax"

It gives this error if I try to do it remotely, or if I'm in the mysql> server.

I've been using this as a resource, and I've used SQL in the past. Any clues as to why I'm getting this error?

Comments

  • ButtersButters CA Icrontian
    edited February 2005
    MySQL likes this better:

    INSERT INTO `newdb`.`newtable`
    SELECT *
    FROM `olddb`.`oldtable`

    this is assuming both structures are the same





    shwaip wrote:
    I'm working on the SMx Stats page, and I'm trying to back up a table using the following:

    "SELECT * INTO Old FROM Current"

    It gives me the error:
    "ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax"

    It gives this error if I try to do it remotely, or if I'm in the mysql> server.

    I've been using this as a resource, and I've used SQL in the past. Any clues as to why I'm getting this error?
  • shwaipshwaip bluffin' with my muffin Icrontian
    edited February 2005
    Works now, thanks alot!
Sign In or Register to comment.