select id,name,
(select personName from Personnel where PerID in(select PerID from PersonJob where JobID=1 and iD=8)) as corpration
from 表A where id=8出错:
子查询返回的值多于一个。当子查询跟随在 =、!=、<、<=、>、>= 之后,或子查询用作表达式时,这种情况是不允许的。因为 (select personName from Personnel where PerID in(select PerID from PersonJob where JobID=1 and iD=8) 中personName 有两条想得到的结果:
id name personname
8 国美 PerA
8 国美 PerBselect personName from Personnel where PerID in(select PerID from PersonJob where JobID=1 and iD=8)
不能取出一条,有多条就取出
解决方案 »
- SQLSERVER2008 有没有类似ORACLE的VARTABLETYPE类型呀?
- 为什么这两句 sql 的结果是一样的?
- 导出的word文档怎么用页面视图显示啊?
- sqlserver2005 字符集问题
- SQL Server的error log里有大量的"DBCC TRACEON 3604, server process ID (SPID) 91"记录
- 这个SQL语句该怎样写?
- 安装SQL SERVER时选的Authentication是Windows only,现在能否改为SQL server and Windows?
- 如何用开发工具捕获SQLSERVER里自定义的异常
- 和数据库高手讨论一下数据库效率
- 如何去掉字段中括号中的部分
- 急求一条简单的select语句的写法。(两表现时查询)
- UPDATE SYSDATABASES SET STATUS =32768 WHERE NAME='ybzx'
(select top 1 personName from Personnel where PerID in(select PerID from PersonJob where JobID=1 and iD=8)) as corpration
from 表A where id=8
(select top 1 personName from Personnel where PerID in(select PerID from PersonJob where JobID=1 and iD=8)) as corpration
from 表A where id=8
(select personName from Personnel where PerID in(select PerID from PersonJob where JobID=1 and iD=8)) as bwhere a.id=8
(select id,personName from Personnel where PerID in(select PerID from PersonJob where JobID=1 and iD=8)) as b where a.id = b.id and a.id=8
表A和Personnel 表的关系字段??