ORA-00979: not a GROUP BY expression [duplicate]
问题 This question already has answers here : ORA-00979 not a group by expression (8 answers) Closed 5 years ago . Why does this work SELECT DISTINCT FIRSTNAME, LASTNAME FROM books, CUSTOMERS, orders, orderitems WHERE STATE IN('FL ', 'GA') GROUP BY orders.order#, firstname, lastname HAVING SUM(retail*quantity) > 80 but when firstname, lastname is removed from group by it doesn't? ORA-00979: not a GROUP BY expression 回答1: In that case where firstname, lastname are removed from the group by , you