Categories
Mastering Development

Mysql query loop, resulting row of one query in where statement of next query

I have a read only table to calculate relationship between people DROP TABLE IF EXISTS `reference`; CREATE TABLE IF NOT EXISTS `reference` ( `self` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL, `brother` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, `mom` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, `wife` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci, PRIMARY KEY […]