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

求sql语句理解

表A
卡号        时间
1                null
2                null
3                null
表B
卡号      时间
1            2008-1-6
1            2004-5-3
2            2005-5-6
3            2003-5-9
3            2001-2-3

问题:更新  表A里的  相应卡号的时间为  表B里相应卡号的(最小)时间
正确的结果:
1      2004-5-3(最小)
2      2005-5-6
3      2001-2-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.时间)



  b          内表
1  2007    1  2007
1  2008    1  2008
1  2004    1  2004

2007  = <all  N
2008  = <all 


相关问答:

如何用c#,sql2000 开发c/s下的工作流?

本人c#新手 可是要求要用c# ,sql2000开发c/s的工作流,一头雾水,请大家帮忙帮忙,给点思路,说的约具体越好,我也好往那个方面去学习
http://www.hxzi.com/view/61402.html
B/S版的,基本思想应该差不多的。。 ......

关于group by的sql语句?

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

pl/sql导入数据问题

我EXCEL中一个单元格的数据如  "2009-01","8949-232"

将这个数据粘贴到PL/SQL中的一个表中后,数据确是成为了 2009-01,8949-232 ,把所有的""都没了,
如何弄呢?请大家试 ......

sql 问题

PB中开发的。

DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)

string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+&q ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号