sqlserver2008视图创建出错,求大神帮忙
CREATEVIEWvusermenuASselectdistincta.useridASuserid,a.logincodeASlogincode,a.username...
CREATE VIEW vusermenu
AS
select distinct a.userid AS userid,
a.logincode AS logincode, a.username AS username,
d.menuid AS menuid , d.menuname AS menuname ,
d.pid AS pid , d.menuurl AS menuurl ,
d.menutype AS menutype , d.ordernum AS ordernum ,
d.icon AS icon
from ((users a join rolemenu c )join menu d )
where ((a.roleid = c.roleid ) and (c.menuid = d.menuid ) )
order by d.ordernum
提示:消息 102,级别 15,状态 1,过程 vusermenu,第 9 行
')' 附近有语法错误。 展开
AS
select distinct a.userid AS userid,
a.logincode AS logincode, a.username AS username,
d.menuid AS menuid , d.menuname AS menuname ,
d.pid AS pid , d.menuurl AS menuurl ,
d.menutype AS menutype , d.ordernum AS ordernum ,
d.icon AS icon
from ((users a join rolemenu c )join menu d )
where ((a.roleid = c.roleid ) and (c.menuid = d.menuid ) )
order by d.ordernum
提示:消息 102,级别 15,状态 1,过程 vusermenu,第 9 行
')' 附近有语法错误。 展开
2个回答
展开全部
--你的写法有问题 试试这个 而且你整那么多括号干嘛
CREATE VIEW vusermenu
AS
select distinct a.userid AS userid,
a.logincode AS logincode, a.username AS username,
d.menuid AS menuid , d.menuname AS menuname ,
d.pid AS pid , d.menuurl AS menuurl ,
d.menutype AS menutype , d.ordernum AS ordernum ,
d.icon AS icon
from users a , rolemenu c , menu d
where a.roleid = c.roleid and c.menuid = d.menuid
order by d.ordernum
CREATE VIEW vusermenu
AS
select distinct a.userid AS userid,
a.logincode AS logincode, a.username AS username,
d.menuid AS menuid , d.menuname AS menuname ,
d.pid AS pid , d.menuurl AS menuurl ,
d.menutype AS menutype , d.ordernum AS ordernum ,
d.icon AS icon
from users a , rolemenu c , menu d
where a.roleid = c.roleid and c.menuid = d.menuid
order by d.ordernum
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询