mysql²Ù×÷ Left join , Right Join, Inner Join
Ò».ÏÈ¿´Ò»Ð©×î¼òµ¥µÄÀý×Ó
Àý×Ó
Table A
aid adate
1 a1
2 a2
3 a3
TableB
bid bdate
1 b1
2 b2
4 b4
Á½¸ö±ía,bÏàÁ¬½Ó,Ҫȡ³öidÏàͬµÄ×Ö¶Î
select * from a inner join
b on a.aid = b.bidÕâÊǽöÈ¡³öÆ¥ÅäµÄÊý¾Ý.
´ËʱµÄÈ¡³öµÄÊÇ:
1 a1 b1
2 a2 b2
ÄÇôleft join Ö¸:
select * from a left join
b on
a.aid = b.bid
È¡³öa±íËùÓÐÊý¾Ý,ÄÃbµÄÊý¾ÝÓëa±È½Ï,ÏàͬµÄÈ¡³ö,²»Í¬µÄbÈ¡¿Õֵȡ³ö
´ËʱµÄÈ¡³öµÄÊÇ:
1 a1 b1
2 a2 b2
3 a3 ¿Õ×Ö·û
ͬÑùµÄÒ²ÓÐright join
select * from a right join
b on
a.aid = b.bid
È¡³öb±íËùÓÐÊý¾Ý,ÄÃaµÄÊý¾ÝÓëb±È½Ï,ÏàͬµÄÈ¡³ö,²»Í¬µÄaÈ¡¿Õֵȡ³ö
´ËʱµÄÈ¡³öµÄÊÇ:
1 a1 b1
2 a2 b2
4 ¿Õ×Ö·û b4
×¢:
¶¼ÊÇÔÚonµÄÌõ¼þÏÂ
¶þ. left join/right join/inner join²Ù×÷ÑÝʾ
±íA¼Ç¼ÈçÏ£º
aID aNum
1 a20050111
2 a20050112
3 a20050113
4 a20050114
5 a20050115
±íB¼Ç¼ÈçÏÂ:
bID bName
1 2006032401
2 2006032402
3 2006032403
4 2006032404
8 2006032408
ʵÑéÈçÏÂ:
1. left join
sqlÓï¾äÈçÏÂ:
SELECT
*
from
A
LEFT
JOIN
B
ON
A.aID
=
B.bID
½á¹ûÈçÏÂ:
aID aNum &
Ïà¹ØÎĵµ£º
<!--#include file="zheboconn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>aspºÍmysql·ÖÒ³´úÂë</title>
<style type="text/css">
<!--
.STYLE3 {
fon ......
Ò»°ãÈË×ÜÊÇÒòΪĿ¹â¶Ìdz¶ø´íʧ׬Ǯ»ú»á£¬larry ÔÚÑ۹ⷽÃæ×ÜÄÜ¿´µÄ³¤Ô¶£¬ÒÔǰһϵÁеÄÊÕ¹º×ãÒÔÖ¤Ã÷¡£²»¹ýÕâ´Î¾Ü¾øÅ·ÃË»á¸øOracle´øÀ´ºÜ´óµÄÂé·³£¬Å·ÖÞÊг¡²»ÒªÁË£¿ ÎÒ²ÂÒ²Ðí»á´ò¹Ù˾¡£ Oracle¶ÔSAPÏòÀ´³ðÊÓ£¬Õâ´ÎSAPÀûÓÃÅ·ÃË´òÁËÒ»¸öƯÁÁµÄ·ü»÷Õ½£¬½ÓÏÂÀ´¾Í¿´OracleÔõô·´»÷ÁË£¬ÊÃÄ¿ÒÔ´ý¡£
......
¹Ø¼ü×Ö: mysql6 mysql6ÏÂÔØ
×÷ΪһÃû¿ª·¢ÈËÔ±,ÎÒ¶ÔÂÌɫСÈí¼þÇéÓжÀÖÓ,ÒòΪÓÃÆðÀ´·½±ã¿ì½ÝÂï,±ãÓÚЯ´ø,Ò×ÓÚÔÚÑÝʾϵͳÖÐʹÓÃ,¿ª·¢Ê±¿ÉÁ¢¼´½øÈë״̬. £¨ÔÚ¸½¼þÖУ©
ÒÔÏÂÊÇÏêϸ˵Ã÷:
MySQL 6 ÂÌÉ«¾«¼ò°æ(BAT°æ±¾)
MySQL 6 Ö§³ÖÍâ¼ü,ÊÓͼ´æ´¢¹ý³Ì,ÊÂÎñµÈ¹¦ÄÜ(ÂÌÉ«¾« ......
ÓÉÓÚ×î½üÒ»Ö±ÔÚÁ˽âmysql¡£¸÷ÖÖ±íÀàÐ͵ÄÊý¾Ý´æ´¢ÒÔ¼°Ïà¹ØÏÞÖƾÍÊDZØÐëÁ˽âµÄ·½ÃæÁË¡£
×Ô¼ºµÄ·þÎñÆ÷»·¾³£ºOS Cent OS ext3£¬memory 4G£¬ disk 2T block size 4K¡£
¾µ÷²é£¬linuxÏÂÎļþ×î´óÊÇ´æÔÚÏÞÖƵġ£È¥googleÉÏËÑÁËËÑ£¬´ó¼Ò˵·¨²»Ò»£¬×îÖÕ×Ô¼º»¹ÊÇÕÒµ½±È½Ï¹Ù·½µÄ˵¡£Ïê¼ûhttp://en.wikipedia.org/wiki/Ext3 ËùÒÔ× ......
mysqlÎļþµ¼ÈëÂÒÂëÎÊÌâµÄ½â¾ö£º
1 ÃüÁî²ì¿´×Ö·ûÉèÖá£
mysql> show variables like "%char%";
2 ½«²»ÊÇutf-8µÄ¶¼¸Ä³Éutf8¡£Ö»ÓÐfilesystem²»±ä;
| Variable_name | Value
&nb ......