读书人

更新字段出错解决思路

发布时间: 2012-02-05 12:07:14 作者: rapoo

更新字段出错
update employee set employee.educationid=k.educationid
from (select employeeid ,educationid c ,max(beginenddate_enddate) from Employeeeducation
where educationid is not null
group by employeeid,educationid ,[name])k
where k.employeeid=employee.employeeid

[解决办法]
from (select employeeid ,educationid c ,max(beginenddate_enddate) as col from Employeeeducation

[解决办法]

探讨

引用:

注意子查询的别名问题。

你确实是解决问题了,为什么要加这个,我用2000的时候没有这个问题呀,用2008有这个问题
as col 是给哪个取别名

读书人网 >SQL Server

热点推荐