我有一个查询:
SELECT availables.bookdate AS Date, DATEDIFF(now(),availables.updated_at) as Age
FROM availables
INNER JOIN rooms
ON availables.room_id=rooms.id
WHERE availables.bookdate BETWEEN '2009-06-25' AND date_add('2009-06-25', INTERVAL 4 DAY) AND rooms.hostel_id = 5094
GROUP BY availables.bookdate
它返回如下内容:
Date Age
2009-06-25 0
2009-06-26 2
2009-06-27 1
2009-06-28 0
2009-06-29 0
然后我怎样才能对返回的行数进行计数..(在本例中为 5)和年龄的总和?只返回一行的计数和总和?
Count SUM
5 3
谢谢