select from 表1,表2,表3,表4,表5 where 条件1,条件2,条件3... order by 字段1,字段2...
假设有table A,B,C,D,E 分别拥有字段a,b,c,d,e shareId 是五张表共有的字段select A.a,B.b,C.c,D.d,E.e from A,B,C,D,E where A.shareId=B.shareId and B.shareId=C.shareId and C.shareId=D.shareId and D.shareID =E.shareID
有什么特殊要求没 没有就直接连接起来就行了。
query += "LEFT JOIN MD0100MAST B ON ";
query += "(A.DB_HOJIN = B.DB_HOJIN AND ";
query += " A.DB_JIGYSYO = B.DB_JIGYSYO) ";
这句?有什么含意
cownew开源团队,国内最活跃的开源团队之一,主要作品:sql翻译引擎、Hibernate建模工具,JDBC监控工具。
网址:http://www.cownew.com
blog:http://www.blogjava.net/huanzhugege
shareId 是五张表共有的字段select A.a,B.b,C.c,D.d,E.e
from A,B,C,D,E
where A.shareId=B.shareId and B.shareId=C.shareId and C.shareId=D.shareId and D.shareID =E.shareID