first time here though I have been using the site a lot, you have a very vast knowledge!
I’m trying to Insert some values in a table XXX, buy my ‘where’ condition is a specific value in another table YYY. I believe I need to use a ‘join’ sentence, but I don’t know how, or where to include it.
My sentence is
INSERT INTO XXX (value1, value2, value3) VALUES (‘value1’, ‘value2’, ‘value3’)
WHERE YYY.value = 2;
but of course, it lacks of this ‘join’ sentence that I don’t know how to use
Any suggestions? I’m trying to do this in a PostgreSQL and SQL Server Database, so any syntax would be good for me
Thanks in advance!
Which database do you use?
For ms-access you can use
select value1, value2, value3 from yyyy WHERE value4 = 2 into xxx