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

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

2013-11-15 14:46:16  來源: 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-2013 電腦知識網 Computer Knowledge   All rights reserved.