易截截图软件、单文件、免安装、纯绿色、仅160KB

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) 


相关问答:

关于group by的sql语句?

  with adod_dict do
    begin
    close;
    commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......

这个SQL该如何写

写SQL语句:
表1:CLASS
含有两个字段:ID,CLASSNAME,表结构如下:
ID CLASSNAME
1    A
2    B
3    C
4    D
表2:STUDENT
含有如下字段:S ......

SQL语句

BeginTime  BtsId Total68PhyRCENum
2009-9-30 0:00 1 192
2009-10-1 0:00 1 192
2009-10-2 0:00 1 192
2009-10-3 0:00 1 192
2009-10-4 0:00 1 256
2009-10-5 0:00 1 256
2009-10-6 0:0 ......

求SQL语句优化工具?

求SQL语句优化工具?
针对SQL Server的
发送到我邮箱sclsmile@163.com
或者给我一个网址链接
关注。

http://www.net130.com/class/oracle_datum_soft/Embarcadero%20SQLTuner%202.0.2.rar

http://sp ......

SQL server数据集出错求助

两种错误:
1.如果我这样申明:ResultSet rs;错误提示如下:

An error occurred at line: 51 in the jsp file: /index.jsp
The local variable rs may not have been initialized
48:    ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号