以下SELECT列表的有效GROUP BY子句是什么:
SELECT Pub_ID, Type, Max (Price)
答案 0 :(得分:2)
您需要GROUP BY两个Pub_ID和Type,因为它们在选择条件中,但不在聚合函数中。
SELECT Pub_ID, Type, MAX(Price) FROM mytable GROUP BY Pub_ID, Type
答案 1 :(得分:1)
Select Pub_ID, Type, max(Price)
from your_table
group by Pub_ID, Type