I have the following MySQL query:
select * from venta as v, pago_venta as pv
where pv.pv_fecha in (SELECT MAX(pv_fecha) FROM pago_venta as p GROUP BY ven_id ) AND v.ven_id = pv.ven_id AND v.ven_cliente= 'Amaia Valentina Cardenas Gonzales'
This query shows the following result:
Now the problem that I can not solve is that I show the last record of each ven_id
, when they have pv_fecha
different dates this query works fine without problems, but if pv_fecha
have the same date shows me the amount of records that are stored on the same date if 10 shows 10 of the same date.
Here you can see my query:
Query BD