B
B
bozilly2015-09-16 02:42:11
MySQL
bozilly, 2015-09-16 02:42:11

How to save the result of a query to a table?

How to save the result of a query to a table?
I write like this

INSERT INTO `test`(`id`, `ru`, `en`, `zh`) 
VALUES (ru.id, ru.name, en.name, zh.name) 
SELECT ru.id, ru.name, en.name, zh.name
FROM ru
LEFT JOIN en ON ru.id = en.id
LEFT JOIN zh ON ru.id = zh.id

Syntax error

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Entelis, 2015-09-16
@bozilly

INSERT INTO `test`(`id`, `ru`, `en`, `zh`) 
SELECT ru.id, ru.name, en.name, zh.name
FROM ru
LEFT JOIN en ON ru.id = en.id
LEFT JOIN zh ON ru.id = zh.id

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question