select * from tbname a, tbname b where a.col1=b.col2;
select a.fee2-b.fee2,a.fee3-b.fee3,a.fee1-b.fee1 from tj_day_pps_t a ,tj_day_pps_t b where a.city_code='318' and a.cacu_date='200409' and b.city_code='318' and b.cacu_date='200408'; 就是两个相关联的表是同一个表,明白了么?
where a.col1=b.col2;
where a.city_code='318' and a.cacu_date='200409'
and b.city_code='318' and b.cacu_date='200408';
就是两个相关联的表是同一个表,明白了么?