1
I need to do an INSERT inside a SELECT in some cases in my Query.
An example of how accurate:
SELECT IdTabela,
Nome,
CASE
WHEN IdTabela > 10
THEN
INSERT INTO TabelaExemplo (IdTabelaExemplo) VALUES (IdTabela)
END
FROM Tabela
I’ve searched several modes on the Internet, and one example I found is this:
INSERT INTO TabelaExemplo
(IdTabelaExemplo)
VALUES (SELECT IdTabela
FROM Tabela
WHERE IdTabela > 10)
But that way doesn’t solve my problem.
Thank you!
At. William
It is that this way does not work in my case friend. I need something very similar to the first example... Thank you!
– M. Guilherme Neves