sql语句问题
各位好:请问下面的这段SQL语句是什么意思啊?以前没看过。谢谢!
String SQL = "select tbdw,tbrq,yuefen,bgshl,bgdhl,qchl,cbry,glhl from ";
SQL += "(select id,tbdw,tbrq,yuefen from jhc_nyxh) a inner join ";
SQL += "(select id,sum(hl) as bgdhl from jhc_nyxh_bg group by id) b on a.id=b.id ";
SQL += "inner join ";
SQL += "(select id,sum(hl) as bgshl from jhc_nyxh_bgs group by id) c on a.id=c.id ";
SQL += "inner join ";
SQL += "(select id,sum(hl) as glhl from jhc_nyxh_gl group by id) d on a.id=d.id ";
SQL += "inner join ";
SQL += "(select id,sum(ry) as cbry from jhc_nyxh_cb group by id) e on a.id=e.id ";
SQL += "inner join ";
SQL += "(select id,sum(hl) as qchl from jhc_nyxh_qc group by id) f on a.id=f.id ";
SQL += "where year(tbrq)='"+nd+"' order by tbdw,yuefen desc";
问题点数:20、回复次数:2Top
1 楼x0y1z2(一个好人)回复于 2006-03-03 12:36:11 得分 0
就是把jhc_nyxh jhc_nyxh_bg jhc_nyxh_bgs jhc_nyxh_gl jhc_nyxh_cb jhc_nyxh_qc作内连接的查询
Top
2 楼bitou(大鹏一日同风起,扶摇直上九万里)回复于 2006-03-03 13:14:52 得分 0
使用了一大串的内联接Top




