Why can't I copy a table MYSQL?

MariaDB [test]> SELECT * INTO city FROM cities ;
ERROR 1327 (42000): Undeclared variable: city

All good afternoon, prompt in what my error?
March 23rd 20 at 19:16
3 answers
March 23rd 20 at 19:18
Solution
No SELECT ... INTO newtable in MySQL no.
RTFM SELECT ... INTO, INSERT ... SELECT
do I understand correctly that the authors of those sites are wrong
the first site
the second site
? - Richie91 commented on March 23rd 20 at 19:21
@Richie91, none of the links do not see what SQL dialect they describe. - citlalli commented on March 23rd 20 at 19:24
It turns out, in some dialects of SQL, this syntax is present, but certainly not in MySQL, right ? - Richie91 commented on March 23rd 20 at 19:27
@Richie91, Exactly. And the dialects still vary in time. If you read the manual on MySQL 4, MySQL 8 some commands may not work, some to not work as in the old version. - citlalli commented on March 23rd 20 at 19:30
March 23rd 20 at 19:20
insert into select
MariaDB [test]> insert into select city FROM cities ;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'select city FROM cities' at line 1
- Richie91 commented on March 23rd 20 at 19:23
5cf8086fbc891076930895.jpeg - Richie91 commented on March 23rd 20 at 19:26
March 23rd 20 at 19:22
insert into city select * from cities ;
I mean to use this syntax 5cf8e1d7774bc883399470.jpeg
and if there is no city table that she has created
5cf8e25082c01787883064.jpeg - Richie91 commented on March 23rd 20 at 19:25
@Richie91, as far as I know, mysql and mariadb respectively do not know how. Syntax select into from clause is not supported and the table is new too, at first it is necessary to create. - jaron_Grimes commented on March 23rd 20 at 19:28

Find more questions by tags MySQL