sql >> Base de Datos >  >> RDS >> Mysql

MySQL Seleccione Dónde fecha máxima y hora máxima

Prueba así

SELECT * FROM
(
  SELECT b.id, b.checkDate, b.checkTime, b.AccountId, b.costCenter, b.percentage, c.id, c.name     
  FROM Buckets b JOIN CustomerAccounts ca ON (b.accountId= ca.linkedAccountId)
                 JOIN Customer c ON (ca.customerId = c.id)
) AS S JOIN 
(
  SELECT max(checkDate) AS MaxDate,max(checkTime) As MaxTime FROM Buckets
) AS T ON T.MaxDate = S.checkDate AND S.checkTime = T.MaxTime