일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- BFS
- 조합
- 코딩테스트
- 완전탐색
- join
- lambda
- 파이썬
- level4
- 프로그래머스
- import re
- itertools
- python
- programmers
- mysql
- Queue
- sql
- 연습문제
- 데이터분석
- cte
- 코딩
- 시간복잡도
- coding test
- time complexity
- Stack
- Level2
- collections
- coding
- 코테
- counter
- lv4
- Today
- Total
목록GENERATION (2)
ror_coding

WITH RECURSIVE (CTE) 로 Level 구하기 !!! 매우 중요! Question You are given a table, BST, containing two columns: N and P, where N represents the value of a node in Binary Tree, and P is the parent of N.Write a query to find the node type of Binary Tree ordered by the value of the node. Output one of the following for each node:Root: If node is root node.Leaf: If node is leaf node.Inner: If node is neith..
RECURSIVE CTE 로 세대 Level 구하는 코드를 사용해야 합니다. Question 각 세대별 자식이 없는 개체의 수(COUNT)와 세대(GENERATION)를 출력하는 SQL문을 작성해주세요.이때 결과는 세대에 대해 오름차순 정렬해주세요. 단, 모든 세대에는 자식이 없는 개체가 적어도 1개체는 존재합니다. Code WITH RECURSIVE GENERATION AS( SELECT ID, PARENT_ID, 1 AS LV FROM ECOLI_DATA WHERE PARENT_ID IS NULL UNION ALL SELECT E.ID, E.PARENT_ID, LV + 1 FROM ECOLI_DATA E JOIN GENERATION G ..