I am trying to execute following query:
Insert into pligg_links_temp
select *
from pligg_links
WHERE link_id > 0 and link_id < 10000;
but I get this error:
#1146 - Table 'chris123_pligg.pligg_links_temp' doesn't exist when trying to execute query to create table
the table does not exist but it should be created in the process or am I wrong?
Copying records from a table to another table can be done in two ways.
selected table fields structure.
Your error stacktrace says that the table
pligg_links_tempdoesn’t exist.Then your statement to
create and inserttable data is incorrect.To copy records from an existing table to a new table, you require to use
CREATE TABLE ... SELECT Syntaxsyntax.Use the following sample:
If the target table already exists, you can use
INSERT ... SELECT Syntaxstatement to copy records.