小小问题

xi_aowo_happy 2008-02-19 03:32:57
select *
from Achievement
where Achievement.EmpID = Employees.EmpID
这个语句分析没错误,执行确提示错误信息:
消息 4104,级别 16,状态 1,第 1 行
无法绑定由多个部分组成的标识符 "Employees.EmpID"。
...全文
53 点赞 收藏 12
写回复
12 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
richardyuan 2008-02-19

select sex =case sex
when '1 ' then '男 '
else '女 '
end
from TB
回复
xi_aowo_happy 2008-02-19
我给沙发多点分,因为其他答案与他相同,依然谢谢所有人。
回复
xi_aowo_happy 2008-02-19
ok,问题解决,结贴。谢谢各位。
回复
zefuzhang2008 2008-02-19
select   Achievement.EmpID,Times,Score,Remarks,   
(select EmpName from Employees where Employees.EmpID=Achievement.EmpID)as 'EmpName',
(select case when EmpSex=1 then '男' else '女' end from Employees where Employees.EmpID=Achievement.EmpID )as 'EmpSex'
from Achievement,Employees
where Achievement.signal=1 and Achievement.EmpID = Employees.EmpID

回复
xi_aowo_happy 2008-02-19
新问题,5楼
回复
ojuju10 2008-02-19

select *
from Achievement,Employees
where Achievement.EmpID = Employees.EmpID

回复
zefuzhang2008 2008-02-19
分析可以通过
分析的过程有一个延迟名称解析过程
回复
xi_aowo_happy 2008-02-19
select Achievement.EmpID,Times,Score,Remarks,
(select EmpName from Employees where Employees.EmpID=Achievement.EmpID)as 'EmpName',
(select EmpSex from Employees where Employees.EmpID=Achievement.EmpID )as 'EmpSex'
from Achievement,Employees
where Achievement.signal=1 and Achievement.EmpID = Employees.EmpID
由于我在Employees表中将EmpSex设成bit型,这样显示是0或1,怎么才能显示‘男’‘女’
回复
pt1314917 2008-02-19

select a.* from Achievement a,Employees b
where a.EmpID = b.EmpID


回复
pt1314917 2008-02-19

select * from Achievement,Employees
where Achievement.EmpID = Employees.EmpID
回复
v888 2008-02-19
select *
from Achievement,Employees
where Achievement.EmpID = Employees.EmpID
回复
kk19840210 2008-02-19
select   * 
from Achievement, Employees
where Achievement.EmpID = Employees.EmpID
回复
相关推荐
发帖
MS-SQL Server
创建于2007-09-28

3.3w+

社区成员

MS-SQL Server相关内容讨论专区
申请成为版主
帖子事件
创建了帖子
2008-02-19 03:32
社区公告
暂无公告