Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a table via SELECT - Why the syntax error?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
I am trying to create a new table from an existing table, using SELECT.
My command is:

CREATE TABLE test SELECT * FROM atlmar2000 WHERE RankInClass <= 3;

The error I get is:

ERROR 1064: You have an error in your SQL syntax near 'SELECT * FROM atlmar2000 WHERE RankInClass <= 3' at line 1

The SELECT statement by itself works fine.
I have reviewed the MySQL.com documentation, and theoretically this should work.
What is the problem?
 
Answer: I am using MySQL 3.22, and this syntax is only supported from version 3.23.
 
i have tried to load table with a .txt file using the following option . But it says file not found

LOAD DATA LOCAL INFILE &quot;pet.txt&quot; INTO TABLE pet;

i get a error message saying 'pet.txt' not found.

how do i get around this .

But Insert command is working.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top