select * from a,b where a.id=b.id
select * from a right join b on a.id=b.id
ÕâÁ½¸öÓï¾ä±¾ÖÊÉÏÓÐʲô²î±ð°¡£¿£¿
µÚÒ»ÌõÓï¾äÖ»»á·µ»ØÂú×ãÌõ¼þa.id=b.idµÄÐС£
µÚ¶þÌõÓï¾ä»á·µ»Øb±íÖÐËùÓеÄÐÐ,a±íÖÐûÓÐÏà¶ÔÓ¦µÄÐÐÓÃnull±íʾ¡£
lz¿ÉÒÔ×Ô¼ºÊÔһϡ£
select * from a,b where a.id=b.id
mysql Ö ......
ÎÒ°ÑÈËÃû shan tian fang ´æÈëÈý¸ö±í¡£
Èç¹ûÊäÈë sh tia fÒª°ÑÕâ¸öÃû×Ö¼ìË÷³öÀ´£¬Äܲ»ÄÜ×öµ½°¡£¿
´ÓǰÍùºóÊäÈ룬Éùĸ²»ÄÜÈ¥µô£¬µ«ÊÇÔÏĸ¿ÉÒÔ²»È«£¬¿ÉÒÔÓÃSQLÓï¾äËÑô£¿Èç¹û¿ÉÒÔÔõôʵÏÖÄØ£¿
Èç¹û¹Ì¶¨¸ñʽµÄ¾Í¿ÉÒÔ£¬µ«ÊÇÁ½¸ö×Ö£¬Ëĸö×ÖµÄÔõô°ì
²¢ÇÒЧÂÊÒ²²»¸ß£¬Æäʵ¿Í»§¶Ë×öÒ»¸öhashmapÖ®ÀàµÄËٶȸü¿ì
sh tia ......
TB1
SQL code:
ID DATE
1 2009Äê1ÔÂ
2 2009Äê12ÔÂ
3 2009Äê3ÔÂ
4 2009Äê6ÔÂ
5 2009Äê2ÔÂ
6 2009Äê3ÔÂ
7 2009Äê6ÔÂ
²éѯid ÔÚ 3,4,5,6,7 ·¶Î§ÄÚ ËùÓÐ date µÃµ½:2009Äê3ÔÂ,2009Äê6ÔÂ,2009Äê2ÔÂ
SQL code:
select distinct date from tb1 where id in (3,4,5,6,7)
S ......
Ö÷±íSP_ProductP
ProductP_ID ProductP_PID ProductP_Order
11 19 1
12 19 2
15 19 3
Ã÷ϸ±íSP_ProductPItem(ProductPI_PID=ProductP_ID)
ProductPI_PID ProductPI_Type ProductPI_MHNO ProductPI_UQty
11 2 BD0001 11
11 2 BD0003 20
11 2 BD0022 5
12 2 BD0005 3
12 4 H-HP ......
sql = "update ¹ÉƱ set [»õ±Ò×ʽð]=" & hb & ",[³¤ÆÚ¸ºÕ®]=" & fz & ",[×ܹɱ¾]=" & zgb & " where [´úÂë]='000010' "
ÎҸijÉÁË
b="000010"
sql = "update ¹ÉƱ set [»õ±Ò×ʽð]=" & hb & ",[³¤ÆÚ ......
±ío
id mid a b c d e
1 1 0.1 0.2 0.3 0.4 0.5
2 2 0.2 0.1 0.4 0.2 0.1
±íst
id mid type value time
1 1 ......