hierarchical-data

hierarchical drop-down list in R shiny

风流意气都作罢 提交于 2020-03-22 07:51:43
问题 We need to create a hierarchical drop-down list in R shiny. The list will have at least 3 levels. Could you please help me in identifying the correct library for this? Please refer the below pic for your reference.Currently we are using the below code.But we are getting incorrect columns in the drop-down. ui.R library(shiny) library(shinydashboard) library(shinyTree) shinyUI( shiny::fluidPage( h3('Countries '), shinyTree("tree", checkbox = TRUE), verbatimTextOutput("x") ) ) server.R library

hierarchical drop-down list in R shiny

江枫思渺然 提交于 2020-03-22 07:51:05
问题 We need to create a hierarchical drop-down list in R shiny. The list will have at least 3 levels. Could you please help me in identifying the correct library for this? Please refer the below pic for your reference.Currently we are using the below code.But we are getting incorrect columns in the drop-down. ui.R library(shiny) library(shinydashboard) library(shinyTree) shinyUI( shiny::fluidPage( h3('Countries '), shinyTree("tree", checkbox = TRUE), verbatimTextOutput("x") ) ) server.R library

Write element's ancestry to Postgres table from adjacency list

六月ゝ 毕业季﹏ 提交于 2020-02-24 11:38:29
问题 I want to write a 1 to n-hierarchy that's stored as an adjacency list to a table that lists each of an element's ancestors. I'm using a Postgres database (Postgres 10, but the machine on which the code is to be deployed runs Postgres 9.x). Sample input table (adjacency list): INSERT INTO public.test (id, name, parent_id) VALUES (1, 't', 1), (11, 't1', 1), (12, 't2', 1), (13, 't3', 1), (111, 't11', 11), (112, 't12', 11), (121, 't21', 12), (14, 't4', 1), (141, 't41', 14), (142, 't42', 14) As a

Get all children by parent id and where clause in mysql

ぃ、小莉子 提交于 2020-01-30 11:45:26
问题 I have a table that stores id and parent_id in same table. I want a recursive query that accepts parent_id as an argument and returns all child nodes with nth level. For this I am using this code and working properly for me. select id, name, parent from (select * from tablename order by parent, id) tablename, (select @pv := '1') initialisation where find_in_set(parent, @pv) > 0 and @pv := concat(@pv, ',', id) My problem start from here: I want to add WHERE clause with result set but unable to

Get all children by parent id and where clause in mysql

社会主义新天地 提交于 2020-01-30 11:42:08
问题 I have a table that stores id and parent_id in same table. I want a recursive query that accepts parent_id as an argument and returns all child nodes with nth level. For this I am using this code and working properly for me. select id, name, parent from (select * from tablename order by parent, id) tablename, (select @pv := '1') initialisation where find_in_set(parent, @pv) > 0 and @pv := concat(@pv, ',', id) My problem start from here: I want to add WHERE clause with result set but unable to

SQL query to get the list of supervisor hierarchy. employee --> supervisor --> supervisor

久未见 提交于 2020-01-30 08:13:05
问题 I have two tables Employee and Department this image shows the manager of every employee. I want to write a SQL query that gives me a list of all the supervisor (Manager, Manager of Manager..). I just want a single column that displays a list of supervisor when given a particular employee. E.g. If I give employee id = 202 then I should receive 200,130 |supervisor | +-----------+ | 200 | | 130 | I have this query WITH emp_dept as( SELECT employee_id,manager_id FROM employee,department WHERE

Is this possible in SQL?

时光怂恿深爱的人放手 提交于 2020-01-23 03:35:07
问题 Let's say I have a table called 'species' with 3 columns: 'Id', 'ancestorId' and 'name'. The 'ancestorId' is the 'Id' of the ancestor specie, so for example if the ancestor of the homo sapiens is the australopithecus, and australopithecus's 'Id' is 5, then homo sapiens's 'ancestorId' is 5. Let's say, also, that there is a specie called 'First specie' whose 'Id' is either 0 or null. So what I want is to select a list of ancestors from a particular specie, say, homo sapiens, to the 'First

how to select all children and grand children of a node in sql / oracle? [duplicate]

吃可爱长大的小学妹 提交于 2020-01-17 07:22:11
问题 This question already has answers here : Recursive query in Oracle (2 answers) Closed 2 years ago . For instance if I have following table with this particular data: Table X Node_ID ParentNode_ID ---- ---- 1 - 2 1 3 1 4 2 5 2 6 4 7 5 8 6 9 8 and I need a query to select children and grand children (and grand grand children...) of node '2', meaning following result: children_of_node2 ------ 4 5 6 7 8 9 how can I do it with a select query and not using functions or declaring variables in oracle

How to traverse a path in a table with id & parentId?

邮差的信 提交于 2020-01-17 03:07:06
问题 Suppose I have a table like: id | parentId | name 1 NULL A 2 1 B 3 2 C 4 1 E 5 3 E I am trying to write a scalar function I can call as: SELECT dbo.GetId('A/B/C/E') which would produce "5" if we use the above reference table. The function would do the following steps: Find the ID of 'A' which is 1 Find the ID of 'B' whose parent is 'A' (id:1) which would be id:2 Find the ID of 'C' whose parent is 'B' (id:2) which would be id:3 Find the ID of 'E' whose parent is 'C' (id:3) which would be id:5

Hierarchical data from DB - to join or not to join

耗尽温柔 提交于 2020-01-14 04:36:26
问题 I am trying to find a clean and performant solution for this problem, but am stuck somehow. Trivia: -ASP.Net C# application (.Net 3.5) -MS-SQL Server 2005 This is how the data looks like: Category -> Template -> Instance A Category can contain multiple Templates. A Template can contain multiple Instances. There is a class for each of these 3 and a corresponding database table with a lot of columns. I want to load a complete category from the database into a C# Category class object, including