ÏÖÓÐtable_for_report_1ºÍtable_for_report_2£¬ÏêÇéÈçÏ£º
table_for_report_1ÓÐnum×ֶΣ¬c1,c2,c3×ֶΡ£
Êý¾ÝÈçÏ£º
num c1 c2 c3
1 15001346690 11 12 13
2 13329921100 21 22 23
3 18900000000 31 32 33
4 13811111111 41 42 43
table_for_report_2ÓÐnum×ֶΣ¬c4,c5×ֶΡ£
Êý¾ÝÈçÏ£º
num c4 c5
1 13822222222 34 35
2 15001346690 14 15
3 13811111111 24 25
ÄÚÁ¬½Ó£º
select t1.num,t1.c1,t1.c2,t1.c3,t2.c4,t2.c5
from table_for_report_1 t1, table_for_report_2 t2
where t1.num=t2.num
½á¹û£º
num c1 c2 c3 c4 c5
1 15001346690 11 12 13 14 15
2 13811111111 41 42 43 24 25
ÍâÁ¬½Ó£¨×óÍâÁ¬½ÓºÍÓÒÍâÁ¬½Ó£©£º
1£©×óÍâÁ¬½Ó£º
select t1.num,t1.c1,t1.c2,t1.c3,t2.c4,t2.c5
from table_for_report_1 t1, table_for_report_2 t2
where t1.num=t2.num(+)
»òÕß
select t1.num,t1.c1,t1.c2,t1.c3,t2.c4,t2.c5
from table_for_report_1 t1 left outer join table_for_report_2 t2
on (t1.num=t2.num)
½á¹û£º
num c1 c2 c3 c4 c5
1 15001346690 11 12 13 14 15
2 13811111111 41 42 43 24 25
3 18900000000 31 32 33
4 13329921100 21 22 23
2£©ÓÒÍâÁ¬½Ó£º
select t2.num,t1.c1,t1.c2,t1.c3,t2.c4,t2.c5
from table_for_report_1 t1, table_for_report_2 t2
where t1.num(+)=t2.num
»òÕß
select t2.num,t1.c1,t1.c2,t1.c3,t2.c4,t2.c5
from table_for_rep
ÓÉÓÚVBAÖдú±íµ¥¸öºÍ¶à¸ö×Ö·ûÊÇÓá°?¡±ºÍ¡°*¡±´ú±íµÄ£¬ËùÒÔÐí¶à¸ÕѧADOµÄÅóÓѾ³£»áÎÊ£ºÎªÊ²Ã´ÔÚSQLÓï¾äÖÐÕâÁ½¸ö·ûºÅ²»ÄÜÓÃÄØ£¿Ó¦¸ÃÓÃʲô·ûºÅÀ´´ú±íÄØ£¿ ÕâÊÇÒòΪVBA+ADOËùÓõÄÇý¶¯µÄ¹Øϵ£¬±¾È˶ÔÕâ¸öÒ²²»ÊÇÌ«¾«£¬¾ßÌå´ó¼Ò¿ÉÒÔȥ΢ÈíµÄÍøÕ¾ÉÏÕÒÕҴ𰸣¬ËùÒÔVBA+ADOµÄSQLÓï¾äÖеġ°*¡±ºÍ¡°?¡±ÕâÁ½¸ö·ûºÅÊÇÓá°%¡±ºÍ¡°_¡±£¬ ......
×î½üÔÚѧϰHibernate£¬Êý¾Ý¿âÊÇSQL 2000£¬myEclipse7.5£¬¸ù¾ÝÀý×ÓÅäÖúÃHibernateÖ®ºóÔËÐУ¬³öÏÖ£º
com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys() Õâ¸ö´íÎ󣬵¹ÌÚ°ëÌìÖ®ºó·¢ÏÖÊÇmsbase.jar¡¢mssqlserver.jar¡¢msutil.jarÕâÈý¸ö°üµÄÎÊÌ⣬SQL 2000µÄÊý¾Ý¿âÇý¶¯ÐèÒª×îеİ汾£¬ÕâÈý¸ö°ü¸ ......