<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: left join 3 table</title>
	<atom:link href="http://www.select2web.com/mysql/left-join-3-table.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.select2web.com/mysql/left-join-3-table.html</link>
	<description>PHP, CSS, Web Development,jQuery,SQL,MySQL,Javascript</description>
	<lastBuildDate>Thu, 11 Mar 2010 04:12:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: J-com</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-1391</link>
		<dc:creator>J-com</dc:creator>
		<pubDate>Wed, 24 Feb 2010 23:26:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-1391</guid>
		<description>ตัวอย่างการใช้งานจริง อีกแบบหนึ่ง

SELECT 
m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,
IFNULL(mem.realName, m.posterName) AS posterName, &quot; . ($user_info[&#039;is_guest&#039;] ? &#039;1 AS isRead, 0 AS new_from&#039; : &#039;
IFNULL(lt.ID_MSG, 
IFNULL(lmr.ID_MSG, 0)) &gt;= m.ID_MSG_MODIFIED AS isRead,			
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from&#039;) . &quot;, LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon
		
FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)
			
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)&quot; . (!$user_info[&#039;is_guest&#039;] ? &quot;
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)&quot; : &#039;&#039;) . &quot;

WHERE t.ID_LAST_MSG &gt;= &quot; . ($modSettings[&#039;maxMsgID&#039;] - 35 * min($num_recent, 5)) . &quot;

AND t.ID_LAST_MSG = m.ID_MSG
AND b.ID_BOARD = t.ID_BOARD&quot; . (empty($exclude_boards) ? &#039;&#039; : &quot;
AND b.ID_BOARD NOT IN (&quot; . implode(&#039;, &#039;, $exclude_boards) . &quot;)&quot;) . &quot;
AND $user_info[query_see_board]
AND ms.ID_MSG = t.ID_FIRST_MSG

ORDER BY t.ID_LAST_MSG DESC
LIMIT $num_recent&quot;, __FILE__, __LINE__);</description>
		<content:encoded><![CDATA[<p>ตัวอย่างการใช้งานจริง อีกแบบหนึ่ง</p>
<p>SELECT<br />
m.posterTime, ms.subject, m.ID_TOPIC, m.ID_MEMBER, m.ID_MSG, b.ID_BOARD, b.name AS bName,<br />
IFNULL(mem.realName, m.posterName) AS posterName, &#8221; . ($user_info['is_guest'] ? &#8216;1 AS isRead, 0 AS new_from&#8217; : &#8216;<br />
IFNULL(lt.ID_MSG,<br />
IFNULL(lmr.ID_MSG, 0)) &gt;= m.ID_MSG_MODIFIED AS isRead,<br />
IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, -1)) + 1 AS new_from&#8217;) . &#8220;, LEFT(m.body, 384) AS body, m.smileysEnabled, m.icon</p>
<p>FROM ({$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b, {$db_prefix}messages AS ms)</p>
<p>LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)&#8221; . (!$user_info['is_guest'] ? &#8221;<br />
LEFT JOIN {$db_prefix}log_topics AS lt ON (lt.ID_TOPIC = t.ID_TOPIC AND lt.ID_MEMBER = $ID_MEMBER)<br />
LEFT JOIN {$db_prefix}log_mark_read AS lmr ON (lmr.ID_BOARD = b.ID_BOARD AND lmr.ID_MEMBER = $ID_MEMBER)&#8221; : &#8221;) . &#8221;</p>
<p>WHERE t.ID_LAST_MSG &gt;= &#8221; . ($modSettings['maxMsgID'] &#8211; 35 * min($num_recent, 5)) . &#8221;</p>
<p>AND t.ID_LAST_MSG = m.ID_MSG<br />
AND b.ID_BOARD = t.ID_BOARD&#8221; . (empty($exclude_boards) ? &#8221; : &#8221;<br />
AND b.ID_BOARD NOT IN (&#8221; . implode(&#8216;, &#8216;, $exclude_boards) . &#8220;)&#8221;) . &#8221;<br />
AND $user_info[query_see_board]<br />
AND ms.ID_MSG = t.ID_FIRST_MSG</p>
<p>ORDER BY t.ID_LAST_MSG DESC<br />
LIMIT $num_recent&#8221;, __FILE__, __LINE__);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pongtornz</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-1387</link>
		<dc:creator>pongtornz</dc:creator>
		<pubDate>Wed, 24 Feb 2010 16:05:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-1387</guid>
		<description>คีร่วม คือ คีนอก หรือ คีที่ใช่อ้างอิงทั้ง 2 ตาราง ที่มีเหมือนกัน
&lt;a href=&quot;http://pongtornz.co.cc&quot; rel=&quot;nofollow&quot;&gt;pongtornz.co.cc&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>คีร่วม คือ คีนอก หรือ คีที่ใช่อ้างอิงทั้ง 2 ตาราง ที่มีเหมือนกัน<br />
<a href="http://pongtornz.co.cc" rel="nofollow">pongtornz.co.cc</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pongtornz</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-1386</link>
		<dc:creator>pongtornz</dc:creator>
		<pubDate>Wed, 24 Feb 2010 16:03:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-1386</guid>
		<description>SELECT * from ชื่อตาราง1
LEFT JOIN ชื่อตาราง2 ON (ชื่อตาราง1.คีร่วม = ชื่อตาราง2.คีร่วม)
LEFT JOIN ชื่อตาราง3 ON (ชื่อตาราง3.คีร่วม=ชื่อตาราง1.คีร่วม)
;</description>
		<content:encoded><![CDATA[<p>SELECT * from ชื่อตาราง1<br />
LEFT JOIN ชื่อตาราง2 ON (ชื่อตาราง1.คีร่วม = ชื่อตาราง2.คีร่วม)<br />
LEFT JOIN ชื่อตาราง3 ON (ชื่อตาราง3.คีร่วม=ชื่อตาราง1.คีร่วม)<br />
;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pongtornz</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-1385</link>
		<dc:creator>pongtornz</dc:creator>
		<pubDate>Wed, 24 Feb 2010 15:57:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-1385</guid>
		<description>SELECT * from order_product 
LEFT JOIN user_login ON order_product.id_login = user_login.id_login
LEFT JOIN category ON (category.id_product=order_product.id_product);

ใช้ได้ชัว ลองมาละ</description>
		<content:encoded><![CDATA[<p>SELECT * from order_product<br />
LEFT JOIN user_login ON order_product.id_login = user_login.id_login<br />
LEFT JOIN category ON (category.id_product=order_product.id_product);</p>
<p>ใช้ได้ชัว ลองมาละ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: platoosom</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-225</link>
		<dc:creator>platoosom</dc:creator>
		<pubDate>Thu, 14 May 2009 01:40:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-225</guid>
		<description>อ่าว เพิ่งเห็นว่าโพสต์ข้างบนบอกว่าเป็น Access</description>
		<content:encoded><![CDATA[<p>อ่าว เพิ่งเห็นว่าโพสต์ข้างบนบอกว่าเป็น Access</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: platoosom</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-224</link>
		<dc:creator>platoosom</dc:creator>
		<pubDate>Thu, 14 May 2009 01:39:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-224</guid>
		<description>แสดงว่าฐานข้อมูลที่ใช้เป็น Access ถ้าเป็นฐานข้อมูล Mysql สามารถ join กันได้โดยไม่ต้องใส่วงเล็บครอบ แต่ถ้าเป็นของไมโครซอฟต์ จะต้องครอบวงเล็บให้ดี ไม่ว่าจะเป็น Access หรือ sql server</description>
		<content:encoded><![CDATA[<p>แสดงว่าฐานข้อมูลที่ใช้เป็น Access ถ้าเป็นฐานข้อมูล Mysql สามารถ join กันได้โดยไม่ต้องใส่วงเล็บครอบ แต่ถ้าเป็นของไมโครซอฟต์ จะต้องครอบวงเล็บให้ดี ไม่ว่าจะเป็น Access หรือ sql server</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suphark</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-220</link>
		<dc:creator>Suphark</dc:creator>
		<pubDate>Wed, 13 May 2009 12:56:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-220</guid>
		<description>“SELECT Material.Description, Category.Name as Category, Company.Name FROM (Material LEFT JOIN Category ON Material.CategoryID = Category.ID) LEFT JOIN Company ON Material.CompanyID = Company.ID ”

ได้ล่ะครับขอบคุณมาก ต้องใส่วงเล็บแบบนี้อ่ะครับ เหมือนคิดเลข
(((Left join 1) Left join2) Left join 3)</description>
		<content:encoded><![CDATA[<p>“SELECT Material.Description, Category.Name as Category, Company.Name FROM (Material LEFT JOIN Category ON Material.CategoryID = Category.ID) LEFT JOIN Company ON Material.CompanyID = Company.ID ”</p>
<p>ได้ล่ะครับขอบคุณมาก ต้องใส่วงเล็บแบบนี้อ่ะครับ เหมือนคิดเลข<br />
(((Left join 1) Left join2) Left join 3)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: platoosom</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-213</link>
		<dc:creator>platoosom</dc:creator>
		<pubDate>Wed, 13 May 2009 01:06:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-213</guid>
		<description>ผมว่าปัญหาน่าจะเกิดจากตรงนี้

Category.Name as Category

ลองเปลี่ยนเป็น Category.Name as Category_Name

ดูนะครับ</description>
		<content:encoded><![CDATA[<p>ผมว่าปัญหาน่าจะเกิดจากตรงนี้</p>
<p>Category.Name as Category</p>
<p>ลองเปลี่ยนเป็น Category.Name as Category_Name</p>
<p>ดูนะครับ</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suphark</title>
		<link>http://www.select2web.com/mysql/left-join-3-table.html#comment-212</link>
		<dc:creator>Suphark</dc:creator>
		<pubDate>Tue, 12 May 2009 15:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.select2web.com/mysql/left-join-3-table.html#comment-212</guid>
		<description>&quot;SELECT Material.Description, Category.Name as Category, Company.Name FROM Material LEFT JOIN Category ON (Material.CategoryID = Category.ID) LEFT JOIN Company ON (Material.CompanyID = Company.ID) &quot;

พิมพ์ตามนี้ไปแล้ว มันยังขึ้น error ว่า

Syntax error (missing operator) in query expression &#039;(Material.CategoryID = Category.ID) Left Join Company ON (Material.companyID = Company.ID)&#039;. 

ปล ใช้ Visual basic 2008 เรียกข้อมูลจาก Access</description>
		<content:encoded><![CDATA[<p>&#8220;SELECT Material.Description, Category.Name as Category, Company.Name FROM Material LEFT JOIN Category ON (Material.CategoryID = Category.ID) LEFT JOIN Company ON (Material.CompanyID = Company.ID) &#8221;</p>
<p>พิมพ์ตามนี้ไปแล้ว มันยังขึ้น error ว่า</p>
<p>Syntax error (missing operator) in query expression &#8216;(Material.CategoryID = Category.ID) Left Join Company ON (Material.companyID = Company.ID)&#8217;. </p>
<p>ปล ใช้ Visual basic 2008 เรียกข้อมูลจาก Access</p>
]]></content:encoded>
	</item>
</channel>
</rss>
