Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4598e74

Browse files
committed
손지민: [SQL ] 저자 별 카테고리 별 매출액 집계하기_250215
1 parent 21014bb commit 4598e74

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
SELECT
2+
a.AUTHOR_ID,
3+
a.AUTHOR_NAME,
4+
b.CATEGORY,
5+
SUM(bs.SALES * b.PRICE) AS TOTAL_SALES
6+
FROM
7+
BOOK_SALES bs
8+
JOIN BOOK b ON bs.BOOK_ID = b.BOOK_ID
9+
JOIN AUTHOR a ON b.AUTHOR_ID = a.AUTHOR_ID
10+
WHERE
11+
bs.SALES_DATE BETWEEN '2022年01月01日' AND '2022年01月31日'
12+
GROUP BY
13+
a.AUTHOR_ID, b.CATEGORY
14+
ORDER BY
15+
a.AUTHOR_ID, b.CATEGORY DESC;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /