- #1
SlurrerOfSpeech
- 141
- 11
I have a book SQL Antipatterns that shows how to use tables to represent a relationship like
with a table like
My question is, What is the point of the rows where ancestor_id=descendant_id? What useful information do they add? Makes no sense.
Code:
1
/ \
2 3
/ \ \
4 5 6
/
7
with a table like
Code:
CommentPaths
============================
ancestor_id | descendant_id
============================
1 1
1 2
1 3
1 4
1 5
1 6
1 7
2 2
2 4
2 5
4 4
5 5
3 3
3 6
3 7
6 6
7 7
My question is, What is the point of the rows where ancestor_id=descendant_id? What useful information do they add? Makes no sense.