我必须创建一个查询来解决这个问题:单个客户在一天内购买的最大票数是多少?您的结果应该有3列(HippCode,购买日期和票数),结果中只有1行。
答案 0 :(得分:0)
HippCode是个人吗?
select HippCode, DateBought as 'Date of Purchase', count(*) as 'Number of Tickets'
from ticket
group by HippCode, DateBought
order by count(*) desc
LIMIT 1