Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

sqlÁ¬½Ó£¨ÄÚÁ¬½Ó¡¢ÍâÁ¬½Ó¡¢È«Á¬½Ó£©

ÏÖÓÐ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


Ïà¹ØÎĵµ£º

ADOµÄSQLÓï¾äÖеġ°*¡±ºÍ¡°?¡±

ÓÉÓÚVBAÖдú±íµ¥¸öºÍ¶à¸ö×Ö·ûÊÇÓá°?¡±ºÍ¡°*¡±´ú±íµÄ£¬ËùÒÔÐí¶à¸ÕѧADOµÄÅóÓѾ­³£»áÎÊ£ºÎªÊ²Ã´ÔÚSQLÓï¾äÖÐÕâÁ½¸ö·ûºÅ²»ÄÜÓÃÄØ£¿Ó¦¸ÃÓÃʲô·ûºÅÀ´´ú±íÄØ£¿ ÕâÊÇÒòΪVBA+ADOËùÓõÄÇý¶¯µÄ¹Øϵ£¬±¾È˶ÔÕâ¸öÒ²²»ÊÇÌ«¾«£¬¾ßÌå´ó¼Ò¿ÉÒÔȥ΢ÈíµÄÍøÕ¾ÉÏÕÒÕҴ𰸣¬ËùÒÔVBA+ADOµÄSQLÓï¾äÖеġ°*¡±ºÍ¡°?¡±ÕâÁ½¸ö·ûºÅÊÇÓá°%¡±ºÍ¡°_¡±£¬ ......

SQL INNER JOIN ¹Ø¼ü×Ö

SQL INNER JOIN ¹Ø¼ü×Ö
 
SQL INNER JOIN ¹Ø¼ü×Ö
ÔÚ±íÖдæÔÚÖÁÉÙÒ»¸öÆ¥Åäʱ£¬INNER JOIN ¹Ø¼ü×Ö·µ»ØÐС£
INNER JOIN ¹Ø¼ü×ÖÓï·¨
SELECT column_name(s)
from table_name1
INNER JOIN table_name2
ON table_name1.column_name=table_name2.column_name
×¢ÊÍ£ºINNER JOIN Óë JOIN ÊÇÏàͬµÄ¡£
ԭʼµÄ±í (ÓÃÔÚÀ ......

ÎåÖÖÌá¸ß SQL ÐÔÄܵķ½·¨

ÎåÖÖÌá¸ß SQL ÐÔÄܵķ½·¨
ÓÐʱ£¬ ΪÁËÈÃÓ¦ÓóÌÐòÔËÐеøü¿ì£¬Ëù×öµÄÈ«²¿¹¤×÷¾ÍÊÇÔÚÕâÀï»òÄÇÀï×öһЩºÜСµ÷Õû¡£°¡£¬µ«¹Ø¼üÔÚÓÚÈ·¶¨ÈçºÎ½øÐе÷Õû£¡³ÙÔçÄú»áÓöµ½ÕâÖÖÇé¿ö£ºÓ¦ÓóÌÐòÖÐµÄ SQL ²éѯ²»ÄÜ°´ÕÕÄúÏëÒªµÄ·½Ê½½øÐÐÏìÓ¦¡£ËüҪô²»·µ»ØÊý¾Ý£¬ÒªÃ´ºÄ·ÑµÄʱ¼ä³¤µÃ³öÆæ¡£Èç¹ûËü½µµÍÁ˱¨¸æ»òÄúµÄÆóÒµÓ¦ÓóÌÐòµÄËٶȣ¬Óû§±ØÐ ......

EclipseÖÐHibernateÅäÖÃSQL Server 2000µÄÎÊÌâ

 ×î½üÔÚѧϰHibernate£¬Êý¾Ý¿âÊÇSQL 2000£¬myEclipse7.5£¬¸ù¾ÝÀý×ÓÅäÖúÃHibernateÖ®ºóÔËÐУ¬³öÏÖ£º
com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys() Õâ¸ö´íÎ󣬵¹ÌÚ°ëÌìÖ®ºó·¢ÏÖÊÇmsbase.jar¡¢mssqlserver.jar¡¢msutil.jarÕâÈý¸ö°üµÄÎÊÌ⣬SQL 2000µÄÊý¾Ý¿âÇý¶¯ÐèÒª×îеİ汾£¬ÕâÈý¸ö°ü¸ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ