During the database table copy and backup operations, we should all know that there are two methods: select into from and insert into select? I will not talk about the differences and usage of the two methods here. If you need them, refer to the article on this site:
Differences and usage of select into from and insert into select
However, when I used select into from to back up mysql Data Tables today, I always returned [Err] 1327-Undeclared variable :...... this error is hard to understand. It is only known after query of relevant information that mysql database does not support the select into from statement, however, after research, we can solve this problem through another work und. Let's talk about the solution to this problem!
You can use
Create table Table2 (Select * from Table1);
This statement is replaced
SELECT vale1, value2, value3 into Table2 from Table1;
The following is an example of my actual operations!
Create table www.phpernote.com (Select A.id,B.id as typeId,A.brand,A.quanpin,A.simple from brands as A,cartype as B where A.type=B.name group by A.brand);
Join two tables to get a query result and insert the result to a newly created table www.phpernote.com.
Articles you may be interested in
- Php prompts PHP Warning: date (): It is not safe to rely on the... solution to the error
- Differences and usage of select into from and insert into select
- Solution to the DedeTag Engine Create File False error in dedeCMS
- Solution to the error "event is not defined" prompt in Firefox
- Php prompts Maximum execution time of 30 seconds exceeded... solution to the error
- Php prompts Call to undefined function curl_init () Error Solution
- How to solve the Call to undefined function curl_init error in php running?
- PHP reports Fatal error Allowed memory size of... how should we solve the problem of insufficient memory?