sql server left join ÎÊÌâ
sqlÓï¾ä£º
select loan_plan_id,l_collect_plan.loan_id,l_collect_detail.collect_isfinished from l_collect_plan
left join l_collect_detail on l_collect_plan.return_times=l_collect_detail.collect_volume and l_collect_plan.loan_id=l_collect_detail.loan_id
µÃµ½£º
loan_plan_id loan_id collect_isfinished
1 1 1 ----1
3 1 1 ----2
4 1 NULL ----3
5 2 NULL ----4
6 2 NULL ----5
7 2 0 ----6
7 2 1 
Ïà¹ØÎÊ´ð£º
±¾ÈËc#ÐÂÊÖ ¿ÉÊÇÒªÇóÒªÓÃc# £¬sql2000¿ª·¢c/sµÄ¹¤×÷Á÷£¬Ò»Í·ÎíË®£¬Çë´ó¼Ò°ïæ°ï棬¸øµã˼·£¬ËµµÄÔ¼¾ßÌåÔ½ºÃ£¬ÎÒÒ²ºÃÍùÄǸö·½Ãæȥѧϰ
http://www.hxzi.com/view/61402.html
B/S°æµÄ£¬»ù±¾Ë¼ÏëÓ¦¸Ã²î²»¶àµÄ¡£¡£ ......
ÓÐʱºòÔÚÊý¾ÝÖвéѯÊý¾ÝµÄʱºò¿¼ÂÇÐÔÄÜÎÊÌ⣬»á½«¸´ÔÓÓï¾ä²ð·Ö»ò½èÓÃÁÙʱ±íÀ´¶à´Î²éѯ×îÖյõ½ÏëÒªµÄÊý¾Ý£¬ÏÖÔÚ½«ÕâЩ²éѯÄÚÈÝ×ö³É±¨±í£¬ÐèҪд¸öÓï¾äÒ»ÆøºÇ³É¡£
ÎÒÏëÎʵÄSQLÊÇ·ñ¿ÉÒÔÔÚ²éѯÓï¾äÒ»½áÊøºó£¬ÔÙ×Ô¶¯Ô ......
linq to sqlÀïÔõÑùʹËüÔÚ²åÈëÊý¾Ýʱ×Ô¶¯½Ø¶Ï¹ý³¤µÄ×Ö·û´®¶ø²»ÊÇÅ׳ö´íÎó
¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£ÎÒͨ³£¶¼ÊÇÌύʱ¾Í¼ì²éËûÔÚ³¤¶È¡£¡£¡£
²»ÊÇ£¬ÏÖÔÚÊÇÏîÄ¿×öÍêÁË£¬ºÜ¶àÄ£¿é²åÈëÊý¾Ýʱ¶¼³öÏÖÕâÑùµÄÎÊÌâ¡£ÒÔÇ°ÓÃsqlpa ......
ÏÖÔÚÐèÒªÔÚSQL ServerʵÏÖ¶¨Ê±±¨±íÊä³öµÄ¹¦ÄÜ£¬
ÀýÈçÔÚÿÌìµÄ12µãÉú³Éµ±ÌìµÄ±¨±í£¬²¢Êä³öµ½Excel»òÆäËü¸ñʽµÄÎļþÖС£
ÎÒµ÷²éÁËһϣ¬ËµSQL Server ±¨±í·þÎñÓÐÕâ¸ö¹¦ÄÜ£¬µ«ÊÇûÓùý±¨±í·þÎñ£¬²»ÖªÈçºÎʵÏÖ£¬Çë ......
ÄÄλ¸ßÊÖÌṩһ¸öSQlÓï¾ä£¬¿ØÖƱíÖÐÖ¸¶¨ÁеÄÖµ±ØÐëÊÇÕýÊý£¿
ÔÚ³ÌÐòÀïÃæÅжϲ»ºÃÂ𣿣¿
Äã¿ÉÒÔÔÚ½¨±íµÄʱºòÓÃcheckÔ¼Êø±íÖеĸÃ×Ö¶Îѽ£¡
È磺
create table tab_name£¨
name varchar2(20),
age numbe ......