Closed github-actions[bot] closed 1 year ago
category example
root@localhost:lupin_dev 03:00:25>select * from category_mst;
+-------------+--------------+-----------+
| category_id | name | parent_id |
+-------------+--------------+-----------+
| 1 | 남성의류 | 111 |
| 2 | 여성의류 | 111 |
| 111 | 의류 | 0 |
+-------------+--------------+-----------+
3 rows in set (0.000 sec)
root@localhost:lupin_dev 03:00:39>select * from category_item_dtl; +-------------+---------+ | category_id | item_id | +-------------+---------+ | 1 | 12345 | | 1 | 123456 | | 2 | 777777 | +-------------+---------+ 3 rows in set (0.000 sec)
root@localhost:lupin_dev 03:00:50>WITH RECURSIVE cte AS ( -> SELECT category_id, name -> , parent_id -> FROM category_mst -> WHERE category_id = 111 -> UNION ALL -> SELECT c.category_id, c.name -> , c.parent_id -> FROM category_mst c -> INNER JOIN cte -> ON cte.category_id = c.parent_id -> ) -> SELECT * -> FROM cte, category_item_dtl a -> where cte.category_id = a.category_id; +-------------+--------------+-----------+-------------+---------+ | category_id | name | parent_id | category_id | item_id | +-------------+--------------+-----------+-------------+---------+ | 1 | 남성의류 | 111 | 1 | 12345 | | 1 | 남성의류 | 111 | 1 | 123456 | | 2 | 여성의류 | 111 | 2 | 777777 | +-------------+--------------+-----------+-------------+---------+ 3 rows in set (0.001 sec)
root@localhost:lupin_dev 03:01:05>WITH RECURSIVE cte AS ( -> SELECT category_id, name -> , parent_id -> FROM category_mst -> WHERE category_id = 1 -> UNION ALL -> SELECT c.category_id, c.name -> , c.parent_id -> FROM category_mst c -> INNER JOIN cte -> ON cte.category_id = c.parent_id -> ) -> SELECT * -> FROM cte, category_item_dtl a -> where cte.category_id = a.category_id; +-------------+--------------+-----------+-------------+---------+ | category_id | name | parent_id | category_id | item_id | +-------------+--------------+-----------+-------------+---------+ | 1 | 남성의류 | 111 | 1 | 12345 | | 1 | 남성의류 | 111 | 1 | 123456 | +-------------+--------------+-----------+-------------+---------+ 2 rows in set (0.001 sec)
회의 일시 / 방식 / 진행자 / 참여 인원
김병국
> 이은송 > 윤종엽 > 정지연회의 내용
지난주 논의
김병국
윤종엽
이은송
정지연
추가 논의
다음주 계획
전체
김병국
윤종엽
이은송
정지연
다음 회의 날짜 / 시간