日期:2014-05-17 浏览次数:20513 次
表menu
id int
parentNode varchar(50)
orderID int
表quanxian
userTypeName varcahr(50)
menuId int
SELECT DISTINCT[userTypeName]
,(menu.parentNode),menu.orderID
FROM [quanxian],menu
where quanxian.menuId=menu.id and [userTypeName]='管理员'
order by menu.orderID
SELECT menu.parentNode,userTypeName,min(menu.orderID) as orderID
FROM [quanxian],menu
where quanxian.menuId=menu.id and [userTypeName]='管理员'
group by menu.parentNode,userTypeName
order by orderID