For issues relating to arranging items into ordered levels.

learn more… | top users | synonyms (2)

3
votes
1answer
39 views

How to maintain trees and their roots in SQLite

I have a (SQLite) database with a table representing nodes in a forest (set of trees): create table "Node" ( "id" Text primary key, "parent" Text references "Node" ("id") -- parent node ...
1
vote
1answer
64 views

Making a very simple product hierarchy in MySQL

I'm importing a list of products from an XML file into a XMLimport landing table in MySQL. A check takes place against the ActiveProducts table to see if there are any new products in XMLimport ...
0
votes
1answer
260 views

Select only rows that equal x but not x and y?

I'm having quite the challenge with selecting hierarchical data in MySQL although I feel the schema should be optimized for it since it's based on the WordPress database model. I've got 4 tables: ...
0
votes
1answer
263 views

How can I use Oracle's CONNECT BY PRIOR to only get specific revisions of hierarchical records?

I've got a table schema in Oracle 11 which is storing records that are linked together. The table schema is roughly like this CREATE TABLE "SOMEDATA" ( "ID" INTEGER NOT NULL, "ITEMNAME" ...
0
votes
1answer
94 views

Hierarcy Query Mysql

I have a table like this... ========================================================================== UID || PARENT ID || SPONSOR ID ...
3
votes
0answers
611 views

How to represent directed graph with multiple parents?

http://dirtsimple.org/2010/11/simplest-way-to-do-tree-based-queries.html provides an algorithm for inserting and deleting from a Closure Table. I'd like to model a similar data structure, except that ...
2
votes
0answers
49 views

How to represent multiple unique constraints across hierarchical tables?

My (shortened) table definition is: CREATE TABLE bus ( id integer NOT NULL PRIMARY KEY, name character varying NOT NULL CHECK (name<>'') ); CREATE TABLE network_node ( id ...
1
vote
0answers
16 views

Model a tree that belongs to a row in another table

Given the tables "users" and "nodes" (which will contain an adjacency list tree) what is the best way to link these tables (each user has a tree). Putting the column "user_id" in the "nodes" table ...
1
vote
0answers
17 views

Heirarchial Database with Time Tracking

Working in Python/Django 1.8 I have a problem along the following lines: Assembly Table |Part |Parent (FK to other Part) i.e.: Car |--Tire |--Bolt A |--Bolt B Journey Table |Date ...
1
vote
0answers
53 views

SSAS Cube for tracking changes in parent child relationship over time

I would like to build an SSAS cube which tracks how objects in a graph who's edges represent a "belongs to" relationship change over time (daily). There are two components to the change: which ...
1
vote
0answers
209 views

How can I optimize a hierarchical query with multiple paths from child to root Oracle SQL?

I am trying to build a query that gives me the hierarchical history of events for a given child event_id. The events are related to each other by some from_id and to_id and the order is determined by ...
1
vote
0answers
48 views

A pre-existing hierarchial table as relational

Currently the database contains something like so (these are the main fields but there's a large amount more): +----------+----------------+----------+ | Agency | parent | main_term ...
0
votes
0answers
41 views

column values combination

I have chains of nodes like A -> B -> C -> F D -> E and store them in an Oracle table pair with 2 columns left_node and right_node left_node right_node A B B C ...
0
votes
0answers
27 views

hierarchical query

I have a Oracle table that has child and parent rows similar to the example below P_JID has the parent's JID, it can go as far as 4 levels JID P_JID NAME STATUS ...
0
votes
0answers
268 views

SQL Server 2008 single-line PIVOT/UNPIVOT combo

I have a request to get information from a table with a stored procedure that shows all the necessary data for in one line. This table includes a hierarchyID, so I am trying to use the HID methods in ...