数据表变量无法与数据表相关联
数据表变量无法与数据表相关联
declare @temp(id,value)
Insert into @temp select id,value from aaa where bbb = ccc
delete @temp where @temp.id = dddd.aaa_id and dddd.eee = ffff
无法正常执行
问题点数:50、回复次数:5Top
1 楼liu0130(Crow)回复于 2005-02-18 01:21:31 得分 0
无法正常指定@temp.id = dddd.aaa_idTop
2 楼hdhai9451(☆新人类☆)回复于 2005-02-18 08:15:41 得分 0
declare @temp table
( id int ,
value numeric(10),
)
Insert into @temp select id,value from aaa where bbb = ccc
delete @temp where @temp.id = dddd.aaa_id and dddd.eee = ffff--->這個語句不對
Top
3 楼zjcxc(邹建)回复于 2005-02-18 08:20:28 得分 40
declare @temp(id int,value varchar(10)) --少写了字段类型
Insert into @temp select id,value from aaa where bbb = ccc
delete a from @temp a,dddd where a.id = dddd.aaa_id and dddd.eee = ffff
Top
4 楼dzhfly(FLY)回复于 2005-02-18 08:20:54 得分 10
delete @temp from @temp as a,dddd as b where a.id = b.aaa_id and b.eee = ffffTop
5 楼liu0130(Crow)回复于 2005-02-18 18:58:06 得分 0
请问zjcxc(邹建)像这类比较复杂的SQL应该看什么书比较好Top




