没有任何的规则吗
如果是这样的,那我给你一个方法
:
create table aa(id,dd,tt,ff,hh,yy)1,insert into aa(dd,tt) select dd ,tt from table1
2,用游标更改新表aa
upate aa set ff=table2.ff,hh=table2.hh,yy=table2.yy from table2
如果是这样的,那我给你一个方法
:
create table aa(id,dd,tt,ff,hh,yy)1,insert into aa(dd,tt) select dd ,tt from table1
2,用游标更改新表aa
upate aa set ff=table2.ff,hh=table2.hh,yy=table2.yy from table2
解决方案 »
- 将字符串转换为datetime 数据类型时失败,请高手帮助解决,谢谢!
- 关于select查询条件简单的问题
- select * from table1 where dt>='2005-08-01' and dt<='2005-08-16' 为什么在执行此语句的时候不包括2005-08-16那天的信息
- sql 符合某条件才 order by 字段
- 高手帮忙,不胜感激!
- 在查询分析器中执行查询,点击取消按钮是取消查询还是停止查询?
- 大家快救救我吧!合并字段问题!~
- 各位爷,sql server2000哪有下载地?
- 请看我的存储过程错在那里?????
- 请教关于MSDE的问题。
- 急!!!各位高手斑竹大哥问个简单的关于存储过程的问题,怎么样可以用插入的存储过程插入的数据不是全部的字段。?????
- 大家帮我想想如何批更新某个字段的值得!谢谢大家了!
from a cross join b
select rank,ff,hh,yy into #test1 from
(select rank=count(*),t1.ff,t1.hh,t1.yy from test1 t1,test1 t2 where t1.ff>=t2.ff group by t1.ff,t1.hh,t1.yy )aselect rank ,dd,tt into #test2 from
(select rank= count(*),t1.dd,t1.tt from test2 t1, test2 t2 where t1.dd>=t2.dd group by t1.dd,t1.tt)aselect dd,tt,ff,hh,yy into #test3 from
(select * from #test2 left join #test1 on #test2.rank =#test1.rank)aselect a.dd ,a.tt,b.ff,b.hh,b.yy from #test2 a left join #test1 b on a.rank=b.rank有點亂,呵呵
declare @_a table( id1 int identity(1,1) ,dd int ,tt int )
declare @_b table( id2 int identity(1,1) ,ff int ,hh int ,yy int )
insert into @_a ( dd , tt) select * from a
insert into @_b ( ff, hh,yy) select * from b
select dd ,tt , ff, hh ,yy from @_a left join @_b on id1 = id2
字段DD,ff不能夠重復,重復的法加強比較條件