熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> SQL Server >> 正文

Sql Server中通過父記錄查找出所有關聯的子記錄

2022-06-13   來源: SQL Server 

  可查級Sql代碼

  select menu_idmenu_nameFather_Id from Sys_Menu where menu_id= or Father_Id= or 一級二級 Father_Id in (select menu_id from Sys_Menu a where menu_id= or Father_Id=) or 三級 father_id in (select menu_id from sys_menu where Father_Id in (select menu_id from Sys_Menu a where menu_id= or Father_Id=)) 四級


From:http://tw.wingwit.com/Article/program/SQLServer/201311/22309.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.