On Mon, Oct 27, 2014 at 4:19 AM, Simon Slavin <slav...@bigfraud.org> wrote: > A foreign key which points to the same table had not occurred to me, outside > of abstract mathematical exercises. I think you've come up with an > acceptable example of why I felt reluctant to condemn the practise.
If you can do a self-join, it stands to reason that you can use a foreign key from one table to itself. A trivial example would be a filesystem with directories implemented as a single table of {parent inode, name, child inode, ...}. Many of the traditional hierarchical examples used to show nested sets and recursive queries should also qualify for having foreign keys from one table to itself. Nico -- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users