17,086
社区成员
发帖
与我相关
我的任务
分享
select mat_name,prod_shift_group,substr(add_time, 7, 2), sum(mat_wt)
from table01,table02
where table01.add_time=table02.create_tiem
add_time > '20110301005010'
and add_time < '20110303060930'
group by mat_name,prod_shift_group,substr(add_time, 7, 2)
--这两个表是通过add_time和create_time进行关联吗?
select mat_name,prod_shift_group,substr(add_time, 7, 2), sum(mat_wt)
from table01,table02
where table01.add_time=table02.create_tiem
add_time > '20110301005010'
and add_time < '20110303060930'
group by mat_name,prod_shift_group,substr(add_time, 7, 2)
select mat_name,prod_shift_group,to_char(add_time,'yyyymmdd'), sum(mat_wt)
from table01,table02
where table01.add_time=table02.create_tiem
add_time > '20110301005010'
and add_time < '20110303060930'
group by mat_name,prod_shift_group,to_char(add_time,'yyyymmdd')