0
Good afternoon!
I would like to perform a select in sql that solves the following question: I have a sales table related to one of products, however, I want to compare the results of the same product in 2018 and 2019.
The table has more or less this structure:
I’d like a result like that:
Can anyone help? Thank you in advance! :)
Try making a Count using the between, and then compare the years Count
– Luiz Augusto
Luiz, can you help me with an example? It would help a lot. Thank you for answering! :)
– Lucas Henrique
https://tapoueh.org/blog/2013/07/simple-case-for-pivoting-in-sql/ pivot with CASE a possible solution. The question is pertinent , I do not understand the criticism.
– Motta
Thanks for the help Motta. I also did not understand the criticism the question, I thought valid... Ball forward!
– Lucas Henrique