Getting “fully qualified” location names from a parent-child table
I have a table that contains place names, and their parent place names. Parents and children have numeric ids as well. For example:
Recursive CTE with window functions
I’m trying to do some log analysis and I’m trying to get a breakdown by the various levels of a domain name… i.e. for a domain name with 4 codons (a.b.c.com for example), I want to be able to roll them up by .com, c.com, b.c.com and a.b.c.com.