-
Notifications
You must be signed in to change notification settings - Fork 0
D23 #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KimGaEul
wants to merge
2
commits into
main
Choose a base branch
from
d23
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
D23 #70
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| 1번 : 조건에 맞는 사용자 정보 조회하기 | ||
| SELECT USER_ID,NICKNAME, | ||
| CONCAT(CITY,' ',STREET_ADDRESS1,' ',STREET_ADDRESS2) AS 전체주소, | ||
| CONCAT(LEFT(TLNO, 3), '-', MID(TLNO, 4, 4), '-', RIGHT(TLNO, 4)) AS 전화번호 | ||
| FROM USED_GOODS_BOARD GB | ||
| INNER JOIN USED_GOODS_USER GU | ||
| ON GB.WRITER_ID=GU.USER_ID | ||
| GROUP BY USER_ID | ||
| HAVING COUNT(USER_ID)>2 | ||
| ORDER BY USER_ID DESC | ||
|
|
||
| 2번 : 조회수가 가장 많은 중고거래 게시판의 첨부파일 조회하기 | ||
| SELECT CONCAT('/home/grep/src/',GB.BOARD_ID,'/',FILE_ID,FILE_NAME,FILE_EXT)AS FILE_PATH | ||
| FROM USED_GOODS_BOARD GB | ||
| INNER JOIN USED_GOODS_FILE GU | ||
| ON GB.BOARD_ID=GU.BOARD_ID | ||
| WHERE GB.VIEWS = ( | ||
| SELECT MAX(GB.views) | ||
| FROM USED_GOODS_BOARD GB ) | ||
| ORDER BY FILE_ID DESC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| 1번 : 보호소에서 중성화한 동물 | ||
| SELECT AO.ANIMAL_ID,AO.ANIMAL_TYPE,AO.NAME | ||
| FROM ANIMAL_INS AI | ||
| INNER JOIN ANIMAL_OUTS AO | ||
| ON AI.ANIMAL_ID = AO.ANIMAL_ID | ||
| WHERE AI.SEX_UPON_INTAKE LIKE 'Intact%' | ||
| AND AO.SEX_UPON_OUTCOME NOT LIKE 'Intact%' | ||
|
|
||
| 2번 : 입양 시각 구하기(2) | ||
| WITH RECURSIVE TIME AS ( | ||
| SELECT 0 AS HOUR | ||
| UNION ALL | ||
| SELECT HOUR + 1 FROM TIME WHERE HOUR < 23 | ||
| ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 rownum 을 사용했는데 |
||
|
|
||
| SELECT T.HOUR, | ||
| IF(AO.HOUR IS NULL,0,AO.COUNT)AS COUNT | ||
| FROM ( | ||
| SELECT HOUR(DATETIME) AS HOUR, | ||
| COUNT(ANIMAL_ID) AS COUNT | ||
| FROM ANIMAL_OUTS | ||
| GROUP BY HOUR | ||
| )AO | ||
| RIGHT JOIN TIME T | ||
| ON T.HOUR = AO.HOUR | ||
|
|
||
| 3번 : 우유와 요거트가 담긴 장바구니 | ||
| SELECT C1.CART_ID | ||
| FROM CART_PRODUCTS C1 | ||
| INNER JOIN CART_PRODUCTS C2 | ||
| ON C1.CART_ID=C2.CART_ID | ||
| WHERE C1.NAME = 'Yogurt' AND C2.NAME ='Milk' | ||
| GROUP BY CART_ID | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전체 검색이 아닌 전위 검색으로 필요한 부분만 명시한 부분 매우 좋네요 👍