How may I create an horizontal view from a tree table
- by Giuseppe Alfieri
I want to create a view for each tree for each customer of this 3 table structured in this way:
Fields: db_attrib.name, db_attrib.name, db_attrib.name until the last db_tree.id_child = 0
Values: db_attrib_values.value where db_attrib.id = db_attrib_value.id_attrib and so on for each child
And so on for each db_tree.id
This is the link to sql fiddle with the prepared structure:
http://sqlfiddle.com/#!9/21516