up有分,请大家帮帮忙如何实现!!!
数据表如下
cate values dates
A1 12.32,15.6,14.5,45.00,78.12,23.45 2006-04-01
A2 14.56,67.23,45.12,23.1,34.67,56.98 2006-04-01
A1 12.31,15.6,14.5,44.00,78.12,23.45 2006-04-01
A2 14.56,67.23,45.12,23.1,34.67,56.98 2006-04-01
A1 12.32,15.6,14.5,45.00,78.12,23.45 2006-05-01
A2 14.56,67.23,45.12,23.1,34.67,56.98 2006-05-01
A1 12.31,15.6,14.5,44.00,78.12,23.45 2006-05-01
A2 14.56,67.23,45.12,23.1,34.67,56.98 2006-05-01
不用存储过程实现如下数据统计
cate T1 dates
A1 24.63,31.2,29.0,89.0,156.24,46.9 2006-04-01
A1 24.63,31.2,29.0,89.0,156.24,46.9 2006-05-01
A2 29.12,134.46,90.24,46.2,69.34,113.96 2006-04-01
A2 29.12,134.46,90.24,46.2,69.34,113.96 2006-05-01
==========================================================================
就是 values 值之间用,隔开的,当cate和dates 相同时 算values中各个以,隔开的数值的累加,要求是不用存储过程实现
------解决方案--------------------up?
------解决方案--------------------up有分
------解决方案--------------------select
distinct t.*
from
表 t
where
not exists(select 1 from 表 where cate=t.cate and dates