Reputation: 1
I'm trying to execute this query:
insert into lvl.tb_jogos a (a.Tags,a.Nome,a.Descricao,a.IdCategoria,a.Tipo)
values
(
(select b.keywords,b.name,b.`desc`,b.cat,b.`type`
from level2.games b, lvl.tb_jogos a
where b.name LIKE `%12 Holes of X-Mas%`
)
)
But SQL return this message:
Error SQL (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right symtax to use near 'a(a.Tags,a.Nome,a.Descricao,a.IdCategoria,a.Tipo) values ( (select b.keywords at line 1
Can you help me?
Upvotes: 0
Views: 58
Reputation: 116048
Replace backticks with single quotes, from this:
LIKE `%12 Holes of X-Mas%`
to this:
LIKE '%12 Holes of X-Mas%'
Also remove extra VALUES and parentheses. Your statement should be:
INSERT INTO lvl.tb_jogos (Tags, Nome, Descricao, IdCategoria, Tipo)
SELECT b.keywords, b.name, b.desc, b.cat, b.type
FROM level2.games b, lvl.tb_jogos a
WHERE b.name LIKE '%12 Holes of X-Mas%'
Upvotes: 0