Sql中笛卡儿积的运用
相当于集合的运用
(1)首先通过from a,b 和where 产生一个类似与a b c 产生 {ab} {ac} {bc}
(2)然后再group
select b.id,b.date,sum(a.pay) from test a,test b where a.date<=b.date group by b.id
相当于集合的运用
(1)首先通过from a,b 和where 产生一个类似与a b c 产生 {ab} {ac} {bc}
(2)然后再group
select b.id,b.date,sum(a.pay) from test a,test b where a.date<=b.date group by b.id