์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
- array๋ list
- ์๊ณ ๋ฆฌ์ฆ ์ธ์ฆ_1์ฃผ์ฐจ
- recyclerview
- ์๊ณ ๋ฆฌ์ฆ ์ธ์ฆ_2์ฃผ์ฐจ
- ๋ค์์ ๋ฆฌํ๊ธฐ
- Filter
- ๋ค์๋ด
- iPortfolio
- ์ทจ์ค๊ธฐ๋ก
- ์๊ณ ๋ฆฌ์ฆ ์ธ์ฆ
- ๋ค์ ์ ๋ฆฌํด์ผํจ
- ์ฝํ๋ฆฐ
- ์ฝ๋ฉํ ์คํธ
- filternot
- foldindexed
- Today
- Total
๋ชฉ๋ก์ ์ฒด ๊ธ (136)
Moments of growth

SELECT DATE_FORMAT(SALES_DATE,'%Y-%m-%d') AS SALES_DATE, PRODUCT_ID, IFNULL(USER_ID, NULL) AS USER_ID, SALES_AMOUNT FROM ( SELECT SALES_DATE, PRODUCT_ID, USER_ID, SALES_AMOUNT FROM ONLINE_SALE UNION SELECT SALES_DATE, PRODUCT_ID, NULL, SALES_AMOUNT FROM OFFLINE_SALE ) AS T WHERE SALES_DATE LIKE '2022-03%' ORDER BY SALES_DATE, PRODUCT_ID, USER_ID ์ฃผ์) FROM์์ UNION ํ ํ ์ด๋ธ์ ์ด๋ฆ์ ๊ผญ ๋ถ์ฌ์ค์ผํ๋ค! -> ์ฌ๊ธฐ์๋ AS T..

SELECT YEAR(SALES_DATE) AS YEAR, MONTH(SALES_DATE) AS MONTH, UI.GENDER, COUNT(DISTINCT OS.USER_ID) AS USERS FROM USER_INFO AS UI JOIN ONLINE_SALE AS OS ON UI.USER_ID = OS.USER_ID WHERE UI.GENDER IS NOT NULL GROUP BY YEAR, MONTH, GENDER ORDER BY YEAR, MONTH, GENDER

SELECT B.AUTHOR_ID, A.AUTHOR_NAME, B.CATEGORY, (SUM(BS.SALES * B.PRICE)) AS SALES FROM BOOK AS B JOIN BOOK_SALES AS BS ON B.BOOK_ID = BS.BOOK_ID JOIN AUTHOR AS A ON B.AUTHOR_ID = A.AUTHOR_ID WHERE SALES_DATE LIKE '2022-01-%' GROUP BY AUTHOR_ID, CATEGORY ORDER BY AUTHOR_ID, CATEGORY DESC ์ฃผ์ํ ์ (SUM(BS.SALES) * B.PRICE) AS SALES ๋ก ํ๋ฉด ํ๋ฆผ -> ์ฑ ๋ง๋ค ๊ฐ๊ฒฉ์ด ๋ค๋ฅด๋๊น ๊ฐ ์ฑ ์ ๊ฐ๊ฒฉ * ๊ทธ ์ฑ ์ ํ๋งค๋์ผ๋ก ๊ณ์ฐํ ๊ฒ์ ํฉ์ ๊ตฌํด์ผํจ
SELECT A.APNT_NO, P.PT_NAME, P.PT_NO, A.MCDP_CD, D.DR_NAME, A.APNT_YMD FROM DOCTOR AS D JOIN APPOINTMENT AS A ON D.DR_ID = A.MDDR_ID JOIN PATIENT AS P ON P.PT_NO = A.PT_NO WHERE A.APNT_YMD LIKE '2022-04-13%' AND A.APNT_CNCL_YN = 'N' ORDER BY A.APNT_YMD ์ด์ค JOIN DOCTOR์ APPOINTMENT ๋๊ฐ๋ฅผ JOIN ํ ๋ค ๊ทธ๊ฑธ AS DA๋ก ๋ง๋ค๊ณ DA์ PATIENT๋ฅผ JOINํ๋ ค๊ณ ํ๊ฑด๋ฐ, DA๋ก ๋ง๋ค๋ฉด ERROR๊ฐ ๋๋ค. ๊ทธ๋ฅ A์ P๋ก JOIN ON ๋ง๋ค๋ฉด ๋๋ค.
SELECT P.PRODUCT_ID,P.PRODUCT_NAME, SUM(O.AMOUNT)*(P.PRICE) AS TOTAL_SALES FROM FOOD_ORDER AS O JOIN FOOD_PRODUCT AS P ON O.PRODUCT_ID = P.PRODUCT_ID WHERE O.PRODUCE_DATE LIKE '2022-05-%' GROUP BY PRODUCT_ID ORDER BY TOTAL_SALES DESC, P.PRODUCT_ID PRODUCT_ID๋ก ๊ทธ๋ฃนํํด์ SUM(O.AMOUNT)*(P.PRICE) AS TOTAL_SALES
SELECT CATEGORY, PRICE AS MAX_PRICE, PRODUCT_NAME FROM FOOD_PRODUCT WHERE CATEGORY IN ('๊ณผ์', '๊ตญ', '๊น์น', '์์ฉ์ ') AND PRICE IN (SELECT MAX(PRICE) FROM FOOD_PRODUCT GROUP BY CATEGORY) GROUP BY CATEGORY ORDER BY MAX_PRICE DESC SELECT MAX(PRICE) FROM FOOD_PRODUCT GROUP BY CATEGORY -> ์นดํ ๊ณ ๋ฆฌ ๋ณ ๊ฐ์ฅ ๋น์ผ ์ํ์ ๊ฐ๊ฒฉ๋ง ๋ชจ์๋ ํ ์ด๋ธ PRICE IN (SELECT MAX(PRICE) FROM FOOD_PRODUCT GROUP BY CATEGORY) ๋์ ๋ง์ฝ ๊ฐ์ ๊ฐ์ ๊ฐ๋ ์ํ์ด ์๋ ๊ฒฝ์ฐ๋..
SELECT USER_ID,PRODUCT_ID FROM ONLINE_SALE GROUP BY USER_ID, PRODUCT_ID HAVING COUNT(ONLINE_SALE_ID) > 1 ORDER BY USER_ID ASC, PRODUCT_ID DESC; GROUP BY ํ๋ฉด์ USER_ID, PRODUCT_ID๊ฐ ๋์์ ๊ฐ์๊ฒ ๋ฌถ์ด๊ณ , ๋ฌถ์ด๋ฉด์ HAVING ์กฐ๊ฑด์ผ๋ก ONLINE_SALE_ID ๊ฐ์๊ฐ 1๋ณด๋ค ํฐ ๊ฒ๋ค๋ง ์ถ๋ ฅํ๋ค HAVING์ GROUP BY์ WHERE ์ญํ
SELECT MCDP_CD AS ์ง๋ฃ๊ณผ์ฝ๋, COUNT(APNT_NO) AS 5์์์ฝ๊ฑด์ FROM APPOINTMENT WHERE APNT_YMD LIKE '2022-05%' GROUP BY ์ง๋ฃ๊ณผ์ฝ๋ ORDER BY 5์์์ฝ๊ฑด์, ์ง๋ฃ๊ณผ์ฝ๋ SELECT MCDP_CD AS '์ง๋ฃ๊ณผ์ฝ๋', COUNT(APNT_NO) AS '5์์์ฝ๊ฑด์' FROM APPOINTMENT WHERE APNT_YMD LIKE '2022-05%' GROUP BY ์ง๋ฃ๊ณผ์ฝ๋ ORDER BY 5์์์ฝ๊ฑด์, ์ง๋ฃ๊ณผ์ฝ๋ ์ค์ํ ๊ฒ AS ๋ค์ ๋ณ์นญ ์ธ ๋๋ ' ' ์จ๋ ๋์ง๋ง GROUP BY์ ORDER BY๋ ' ' ์ฐ๋ฉด ์ค๋ฅ๋จ ํ๊ธ์ด์ด๋ ' ' ์ ์จ๋ ๋๋ค!