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.
次のようなテーブルがあります。
表: コメント、行: id、作成者、コンテンツ、返信先
「replyto」で同じテーブルの「id」を参照したいのですが、どうすればよいですか?
どうもありがとう。
何かのようなもの:
ALTER TABLE comments ADD CONSTRAINT `my_recursive_constraint` FOREIGN KEY (`reply_to`) REFERENCES `comments` (`id`)