sqlserver数据库新创建视图,增加一列自增id ,列名就为ID,小生语句在补充,求正确sql语句,谢谢
createviewview_personasselecta.strNameasstrName,convert(nvarchar(20),CardID)asnLOCard...
create view view_person
as
select
a.strName as strName,
convert(nvarchar(20),CardID) as nLOCardNo
from view_one as a inner join (select distinct CardID,EmpSysID from MJ_MjData)
as b on a.EmpSysID=b.EmpSysID 展开
as
select
a.strName as strName,
convert(nvarchar(20),CardID) as nLOCardNo
from view_one as a inner join (select distinct CardID,EmpSysID from MJ_MjData)
as b on a.EmpSysID=b.EmpSysID 展开
1个回答
展开全部
create view view_person
as
select ROW_NUMBER() over(order By a.strName) as ID,--想按什么排序就order By什么
a.strName as strName,
convert(nvarchar(20),CardID) as nLOCardNo
from view_one as a inner join (select distinct CardID,EmpSysID from MJ_MjData)
as b on a.EmpSysID=b.EmpSysID
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询