2
I am trying to create an INSERT INTO in an X table by making a filter in table Y, but I get a syntax error. I’ve researched what could be wrong, but not found.
INSERT INTO products (
SELECT * FROM products AS P
WHERE P.FK_ID_QUOTE = 101
)
What would be the goal of putting a "Where" in the Insert?
– Woss
I want to specify in which id of the quote table I want to add what I Filtred
– Leonardo Vinicius
You want to duplicate a record by changing the id?
– Sorack
if I understand the comment the idea is to change a record, not to include a new one... no?
– rLinhares
No. I created a function to duplicate a quote with a new id, but I need to copy all products from the reference quote to the new quote. This query I posted is wrong. I will edit. But what I need is to copy the filter products with new id and associate the duplicate quote. In the end I want everything to be duplicated with new ids
– Leonardo Vinicius