Insert into A表(A表.a,A表.b,A表.c,A表.d)
Select B表.a,C表.b,count(*),to_date('20081101 110000','yyyymmdd hh24miss')
From A表,B表,C表
Where B表.m=C表.m
Group by B.a,C表.b,A表.d我要把 A表.d 赋一个固定的值,是这样做吗?
Select B表.a,C表.b,count(*),to_date('20081101 110000','yyyymmdd hh24miss')
From A表,B表,C表
Where B表.m=C表.m
Group by B.a,C表.b,A表.d我要把 A表.d 赋一个固定的值,是这样做吗?
--改了一下:Insert into A表(a,b,c,d)
Select B表.a,
C表.b,
(select count(*) from b),
to_date('20081101 110000','yyyymmdd hh24miss')
From B表,C表
Where B表.m=C表.m;
按B表的字段1数据分组,把A表的字段3填一个固定值。A表的字段1,字段2分别填B表.字段1,和符合分组条件的数据条数
Insert into A表(字段1,字段2,字段3)
Select B表.字段1,Count(*), to_date('20081101 110000','yyyymmdd hh24miss')
From B表
Group by B表.字段1
这样大家懂我的意思吧
from tableB tb,tableC tc
where tb.m=tc.m
group by tb.a,tc.b;
select tab.f1,tab.f2,tab.f3,to_date('20081101 110000','yyyymmdd hh24miss')
from (Select B表.a f1,C表.b f2,A表.d,count(*) f3
From A表,B表,C表
Where B表.m=C表.m
Group by B表.a,C表.b,A表.d) tab;
如下:对不对?
Insert into A表(字段1,字段2,字段3)
Select B表.字段1,Count(*), to_date('20081101 110000','yyyymmdd hh24miss')
From B表
Group by B表.字段1