How Sql query for tree from two tables [on hold]












-2















table : Group



id parentId name
----------------
1 0 Category1
2 1 Category1_2


table : Depart_Group



id parentId name Group_Id
----------------
1 0 Name1 1
2 1 Name2 1
3 0 Name3 2
4 3 Name4 2


How have table tree:



Category1
-- Category1
--Name1
---- Name2
-- Category1_2
--Name3
---- Name4









share|improve this question









New contributor




Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as unclear what you're asking by Akina, Erik Darling, Colin 't Hart, mustaccio, John Eisbrener 10 hours ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • Why so? unclear...

    – Akina
    19 hours ago
















-2















table : Group



id parentId name
----------------
1 0 Category1
2 1 Category1_2


table : Depart_Group



id parentId name Group_Id
----------------
1 0 Name1 1
2 1 Name2 1
3 0 Name3 2
4 3 Name4 2


How have table tree:



Category1
-- Category1
--Name1
---- Name2
-- Category1_2
--Name3
---- Name4









share|improve this question









New contributor




Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as unclear what you're asking by Akina, Erik Darling, Colin 't Hart, mustaccio, John Eisbrener 10 hours ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
















  • Why so? unclear...

    – Akina
    19 hours ago














-2












-2








-2








table : Group



id parentId name
----------------
1 0 Category1
2 1 Category1_2


table : Depart_Group



id parentId name Group_Id
----------------
1 0 Name1 1
2 1 Name2 1
3 0 Name3 2
4 3 Name4 2


How have table tree:



Category1
-- Category1
--Name1
---- Name2
-- Category1_2
--Name3
---- Name4









share|improve this question









New contributor




Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












table : Group



id parentId name
----------------
1 0 Category1
2 1 Category1_2


table : Depart_Group



id parentId name Group_Id
----------------
1 0 Name1 1
2 1 Name2 1
3 0 Name3 2
4 3 Name4 2


How have table tree:



Category1
-- Category1
--Name1
---- Name2
-- Category1_2
--Name3
---- Name4






sql-server join recursive






share|improve this question









New contributor




Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 19 hours ago









a_horse_with_no_name

39k775112




39k775112






New contributor




Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked yesterday









Đại ĐặngĐại Đặng

1




1




New contributor




Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Đại Đặng is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as unclear what you're asking by Akina, Erik Darling, Colin 't Hart, mustaccio, John Eisbrener 10 hours ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






put on hold as unclear what you're asking by Akina, Erik Darling, Colin 't Hart, mustaccio, John Eisbrener 10 hours ago


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.















  • Why so? unclear...

    – Akina
    19 hours ago



















  • Why so? unclear...

    – Akina
    19 hours ago

















Why so? unclear...

– Akina
19 hours ago





Why so? unclear...

– Akina
19 hours ago










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

SQL Server 17 - Attemping to backup to remote NAS but Access is denied

Always On Availability groups resolving state after failover - Remote harden of transaction...

Restoring from pg_dump with foreign key constraints