Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ドキュメント管理システムに「フォルダー」を保存するためのテーブルがあります。以下のテーブル構造
folder_id name parent_id
親フォルダーを指す同じテーブルの参照キーを次に示しparent_idます。そのため、フォルダー ID からすべてのフォルダー ID を取得する必要があります。つまり、フォルダーのサブフォルダー リストです。
parent_id
自己結合として単一のクエリを取得することは可能ですか?