sql 悲剧
http://topic.csdn.net/u/20091008/12/a2577eba-1b5b-4e1e-ab20-0a047bf3f8d7.html?4385
1楼
liangCK
SQL code:
update a set
时间 = b.时间
from tb1 as a
join tb2 as b
on a.卡号= b.卡号
where not exists(select * from tb2
where 卡号=b.卡号 and 时间> b.时间)
3楼
liangCK
SQL code:
update a set
时间 = b.时间
from @tb1 as a
join @tb2 as b
on a.卡号= b.卡号
where not exists(select * from @tb2
where 卡号=b.卡号 and 时间< b.时间)
当时我没有看到3楼的正解,于是就发了一个帖子
http://topic.csdn.net/u/20091008/13/490b3e82-3e4c-4e7d-a5a1-a2632e355bd8.html?32712
看来 wufeng4552 xuejie09242 navy887
都没有看到 帖子中的错误啊
b 内表
1 2007 1 2007
1 2008 1 2008
1 2004 1 2004
2007 = <all N
2008 = <all n
2004 = <all n
应该是把比最小的都排除掉
比如
2007>(2007 2008 2004) y
2008>(2007 2008 2004)
相关问答:
....接到一个小程序..工作原来大概是这样的...前台是WEB服务器.架构就是ASP+SQL..前台由ASP向SQL添加服务类别(表单).然后又后台程序读取表单..要实时读取..然后显示在服务器上面..从理论上面能行通不?如果可以..后台 ......
写SQL语句:
表1:CLASS
含有两个字段:ID,CLASSNAME,表结构如下:
ID CLASSNAME
1 A
2 B
3 C
4 D
表2:STUDENT
含有如下字段:S ......
id name sfz
1 aa 410654198001204562
2 bb 410654198120461287
4 cc 41065419850 ......
我现在有2个表Table1,Table2。对应的字段、数据如下:
Table1:primary key(a1)
a1(char) a2(int)
a 10
b & ......
求SQL语句优化工具?
针对SQL Server的
发送到我邮箱sclsmile@163.com
或者给我一个网址链接
关注。
http://www.net130.com/class/oracle_datum_soft/Embarcadero%20SQLTuner%202.0.2.rar
http://sp ......