1
I have a sales chart and would like to select customers' sales, but if the customer made more than one sale per month, I would like you to bring the oldest just, how could I do that?
I don’t have an SQL code to provide because I don’t know where to start, but I have the table in question:
How I wish it was the return:
Notice that line 2 is gone, because the customer "João" made 2 purchases in January and brought only the oldest purchase of it.
I’m just studying, these tables are just fictitious.
The oldest purchase of the month of January of Joseph would not be day 2?
– novic
@Virgilionovic In the case the purchase of the day 02/01 is the most recent, since it is closer to the current day, so the day 01/01 is the oldest of him.
– D. Watson
I got it, I made an example!
– novic