14. SELECT c1.*, c2.*, c3.*, c4.* FROM Comments c1 -- 1階層目 LEFT OUTER JOIN Comments c2 ON c2.parent_id = c1.comment_id -- 2階層目 LEFT OUTER JOIN Comments c3 ON c3.parent_id = c2.comment_id -- 3階層目 LEFT OUTER JOIN Comments c4 ON c4.parent_id = c3.comment_id -- 4階層目 アンチパターンにより起こること 素朴すぎる故に アンチパターン
![SQLアンチパターン - 開発者を待ち受ける25の落とし穴 (拡大版)](https://cdn-ak-scissors.b.st-hatena.com/image/square/8ecda6b1caba0408e709d5061c6ed5070bdd4552/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fsqlantipatternsdigest-130422021147-phpapp02-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)