[프로그래머스/SQL] GROUP BY 저자 별 카테고리 별 매출액 집계하기
문제 설명 문제 풀이 1 2 3 4 5 6 7 SELECT b.author_id, a.author_name, b.category, sum(s.sales*b.price) FROM book b, author a, book_sales s WHERE b.author_id = a.author_id and b.book_id = s.book_id and to_char(s.sales_date, 'YYYY-MM') = '2022-01' GROUP BY b.author_id, a.author_name, b.category ORDER BY 1, 3 desc; Colored by Color Scripter cs