Today I have this function, I also need to return the last record of each user\'s computer: SELECT *, COUNT(IDCupom) AS TotalCupons FROM cupons WHERE TipoCupom = \'D\' AND I