相关子查询,ZZFNO其实是引用了外部查询表T_ZMFC的ZZFNO字段
解决方案 »
- 求SQL查询语句。基础
- SQL 设置列别名
- Sql Server服务管理器能启动,进入企业管理器后·就是不能登录(两种模式都不行)
- select 语句可以套嵌if吗?????
- 老大请进,这样求和,要求结果只有一行,请问该如何做?在线等待阿,急!!!!
- sql查询
- 结存不正确?
- select top 8000 id=identity(int,1,1) into # from syscolumns a,syscolumns b
- 急救!数据库高手
- SQL Server 2000作为网络数据库服务器的问题
- 55555...我的SQL数据库出大问题了!。。。
- SQL 存储过程执行很慢,但是复制出来单独执行很快!为什么呢?
declare @t1 table(a int,b int)
insert into @t1
select 1,2
declare @t2 table(b int)
/*
--select a from @t1 where a=1 and a in(select c from @t2)
服务器: 消息 207,级别 16,状态 3,行 7
列名 'c' 无效。
*/
/*
select a from @t1 where a=1 and a in(select a from @t2)
@t2无记录时,没有查询结果。*/
/*
insert into @t2
select 3
select a from @t1 where a=1 and a in(select a from @t2)a
---
1
*/--综上,a in(select a from @t2)中的select a from @t2相当于select a from @t2,@t1
go
select top 1 *
from orders as t1
where exists(
select customerid
from [order details] as t2
)