亚洲欧洲国产欧美一区精品,激情五月亚洲色五月,最新精品国偷自产在线婷婷,欧美婷婷丁香五月天社区

      考試首頁(yè) | 考試用書(shū) | 培訓(xùn)課程 | 模擬考場(chǎng) | 考試論壇  
      全國(guó)  |             |          |          |          |          |         
        當(dāng)前位置:計(jì)算機(jī)等級(jí) > 二級(jí)考試 > MySQL數(shù)據(jù)程序設(shè)計(jì) > MySQL 輔導(dǎo) > 文章內(nèi)容
        

      全國(guó)計(jì)算機(jī)等級(jí)考試二級(jí)MySQL教程(54)

      中華IT學(xué)院   【 】  [ 2016年2月22日 ]

      MySQL left join 與 join 有所不同。 MySQL LEFT JOIN 會(huì)讀取左邊數(shù)據(jù)表的全部數(shù)據(jù),即便右邊表無(wú)對(duì)應(yīng)數(shù)據(jù)。

      實(shí)例

      嘗試以下實(shí)例,理解MySQL LEFT JOIN的應(yīng)用:

      root@host# mysql -u root -p password;
      Enter password:*******
      mysql> use TUTORIALS;
      Database changed
      mysql> SELECT a.tutorial_id, a.tutorial_author, b.tutorial_count
          -> FROM tutorials_tbl a LEFT JOIN tcount_tbl b
          -> ON a.tutorial_author = b.tutorial_author;
      +-------------+-----------------+----------------+
      | tutorial_id | tutorial_author | tutorial_count |
      +-------------+-----------------+----------------+
      |           1 | John Poul       |              1 |
      |           2 | Abdul S         |           NULL |
      |           3 | Sanjay          |              1 |
      +-------------+-----------------+----------------+
      3 rows in set (0.02 sec)

      以上實(shí)例中使用了LEFT JOIN,該語(yǔ)句會(huì)讀取左邊的數(shù)據(jù)表tutorials_tbl的所有選取的字段數(shù)據(jù),即便在右側(cè)表tcount_tbl中沒(méi)有對(duì)應(yīng)的tutorial_author字段值。

      分享到:
      本文糾錯(cuò)】【告訴好友】【打印此文】【返回頂部
      將考試網(wǎng)添加到收藏夾 | 每次上網(wǎng)自動(dòng)訪問(wèn)考試網(wǎng) | 復(fù)制本頁(yè)地址,傳給QQ/MSN上的好友 | 申請(qǐng)鏈接 | 意見(jiàn)留言 TOP
      關(guān)于本站  網(wǎng)站聲明  廣告服務(wù)  聯(lián)系方式  站內(nèi)導(dǎo)航  考試論壇
      Copyright © 2007-2013 中華考試網(wǎng)(Examw.com) All Rights Reserved