일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |
- sql
- lv4
- LeetCode
- 코테
- import re
- 조합
- mysql
- cte
- 코딩테스트
- 프로그래머스
- counter
- hackerrank
- tableau
- itertools
- Stack
- time complexity
- Queue
- coding
- coding test
- Level2
- programmers
- lambda
- python
- 코딩
- Growth hacking
- AARRR
- join
- 파이썬
- 완전탐색
- level4
- Today
- Total
목록ROW_NUMBER (2)
ror_coding

row_number() 로 홀짝을 구별하여 id에서 빼거나 더한 값을 id로 부여합니다. 따라서 이름은 고정, id만 바뀜. Question Write a solution to swap the seat id of every two consecutive students. If the number of students is odd, the id of the last student is not swapped.Return the result table ordered by id in ascending order.The result format is in the following example. Code select row_number() over(order by if(id % 2 = 0, id - 1, id..
RANK() 사용과 COUNT(*) OVER() 로 순위와 총 대장균들의 수를 저장하고 연산 ! Question 대장균 개체의 크기를 내름차순으로 정렬했을 때 상위 0% ~ 25% 를 'CRITICAL', 26% ~ 50% 를 'HIGH', 51% ~ 75% 를 'MEDIUM', 76% ~ 100% 를 'LOW' 라고 분류합니다. 대장균 개체의 ID(ID) 와 분류된 이름(COLONY_NAME)을 출력하는 SQL 문을 작성해주세요. 이때 결과는 개체의 ID 에 대해 오름차순 정렬해주세요 . 단, 총 데이터의 수는 4의 배수이며 같은 사이즈의 대장균 개체가 서로 다른 이름으로 분류되는 경우는 없습니다. Point RANK() 사용.COUNT(*) OVER() AS CNTS Code : After SEL..