1
I have the following table:
I need to bring only the oldest customer sale, regardless of the type of sale, however I need the sale guy to come on select
, before I had a similar doubt and helped me here in Stackoverflow, but increasing the level of studies, I arrived at this problem.
Before I had the following query
and it was working, but I didn’t have the "kind" of sale, now having the kind of sale, it makes it impossible to use the Group By
, how could I do:
SELECT
loja,
nome,
MONTH(data)
MIN(data)
FROM vendas
GROUP BY loja, nome, MONTH(data)
I need to get the following result: