Select @A=b.A, @B=b.B
from 表C a Join
表Y b on a.A=b.A
where a.D=@D
from 表C a Join
表Y b on a.A=b.A
where a.D=@D
解决方案 »
- 请问如何简化下面的触发器?
- 怎样导出SQL语句
- 50分寻一个查询重名的查询(在线等)
- 数据导入的问题
- 有关生成交叉表的长度超过8000的难题,请邹建等高手进来看看!!!!
- 为何企业管理器里能连接上订阅服务器,而在发布后却连接不上订阅服务器呢?
- 求windows自带的可生成各种数据库连接字符串工具打开方法!
- Cannot resolve the collation conflict between "Latin1_General_CI_AI" and "SQL_Latin1_General_CP1_CI_
- 求解SQL SERVER 分布式问题
- 怎样将recordeset中的数据导入到一个表中?用一句SQL语句。access数据库。
- 救命!!!(急!在线等)
- 关于字符串处理的问题请高手帮忙??
from 表Y a,表c b
where b.d=@d and a.a=b.a
from 表Y
where @A in ( select A
from 表C
where 表C.A=@D)
必须是当变量@D=(旺财)时 才行
create table y (a char (2),b char (2))insert into c
select '01','小强'
union
select '02','旺财'insert into y
select '01','19'
union
select '02','20'
union
select '03','21'
union
select '04','22'
declare @a char (10),@b char (10),@d char (10)
set @d='旺财'
select @A=a.A ,@B=a.B
from Y a,c b
where b.d=@d and a.a=b.a
select @a,@b,@d01 19 小强
from 表Y
where @A in ( select A
from 表C
where rtrim(表C.A)=@D) --去尾空格
create table y (a char (2),b char (2))insert into c
select '01','小强'
union
select '02','旺财'insert into y
select '01','19'
union
select '02','20'
union
select '03','21'
union
select '04','22'
declare @a char (10),@b char (10),@d char (10)
set @d='小强'
select @A=a.A ,@B=a.B
from Y a,c b
where b.d=@d and a.a=b.a
select @a,@b,@d01 19 小强