Answer the question
In order to leave comments, you need to log in
How to write the result of a complex query to a table?
There is a table with sales by day. It naturally has a huge number of lines. From this table, I form a PIVOT to group sales by month. I do this with a complex query where months are dynamically determined from a date, columns for PIVOT are formed from them, and the result is displayed. Essence of the question. There is a second table in which I need to enter the result of this PIVOT. Is it possible at all. I naturally know about INSERT INTO SELECT. This works well when it comes to SELECT FROM WHERE. And here is a huge request in which variables are declared at the beginning. And INSERT immediately swears that it is waiting for the SELECT construct.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question