-1
I have a table with customer purchase records, I would like to select only the last purchase of each customer. How to do this? I tried to use DISTINCT, but I have other data I need and are not possible to group, as the date.
For example:
Client A
Compra 1
Compra 2
Client B
Compra 1
Compra 2
Client C
Compra 1
Compra 2
Compra 3
The Result must be:
Cliente A Compra 2
Cliente B Compra 2
Cliente C Compra 3
you can make a sub-query to bring that information, or left
– aa_sp
Fernando, could you pass more information on the table? tell what is the type of data stored in the com column
Compra 1
, this table has some column of id? this information is important for a solution more suitable to your problem.– Caique Romero