I need to do an INSERT within a SELECT in some cases in my Query.
An example of how I need to:
SELECT IdTabela,
Nome,
CASE
WHEN IdTabela > 10
THEN
INSERT INTO TabelaExemplo (IdTabelaExemplo) VALUES (IdTabela)
END
FROM Tabela
I've looked for several modes on the internet, and an example I found is this:
INSERT INTO TabelaExemplo
(IdTabelaExemplo)
VALUES (SELECT IdTabela
FROM Tabela
WHERE IdTabela > 10)
But this does not solve my problem.
Thank you!
At. Guilherme