select destname from destination where destinationid in (select destinationid from booking group by destinationid having bookamount> (select avg(bookamount) from booking));
执行之后,它向我显示错误的输出。在那之后我试过这个。通过此查询,我可以获得每个目的地的平均金额,现在我需要知道单个预订金额大于该地点平均完成金额的目的地:
select destinationid, avg(bookamount) from booking group by destinationid;
但我需要一个正确的建议。
我试过硬编码,但我知道这样做是错误的:
2条答案
按热度按时间cs7cruho1#
是否要查找超过目的地平均金额的预订?
rqcrx0a62#
那么这个怎么样?