2
I need to create an INSERT where it is checked if the value already exists. I looked at some posts, but I am not able to execute.
INSERT INTO `pagina_extra` (`ID_PExtra`, `ordem_paginas`, `id_menu`, `url_seo`, `url`, `nome`, `titulo`, `conteudo`, `exibir`, `interno`)
SELECT * FROM (SELECT 'NULL', '3', '1', 'downloads', 'pag_downloads.php', 'Downloads', '', '', 'N', 'N') AS tmp
WHERE NOT EXISTS (
SELECT url_seo FROM pagina_extra WHERE url_seo = 'downloads'
) LIMIT 1;
Error that appears when I test directly in Phpmyadmin:
Duplicate column name 'Downloads'
But there is no value to double accuse. What is wrong?
query is not seeing words with
case sensitive
then when Voce says'downloads'
and'Downloads'
is the same thing.– RFL
And what is the solution?
– Tiago
I do not know at what point of the development you this but the ideal was to leave the names of the columns different, even because it gets very strange and maybe it generates some future disorder having 2 columns with the same name.
– RFL
solved your problem ?
– Marco Souza