<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>phoenixdigital.com</title>
	<atom:link href="http://blog.phoenixdigital.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.phoenixdigital.com</link>
	<description>General tech and something something</description>
	<lastBuildDate>Fri, 20 Aug 2010 08:33:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Reset an old Nokia Mobiles</title>
		<link>http://blog.phoenixdigital.com/?p=428</link>
		<comments>http://blog.phoenixdigital.com/?p=428#comments</comments>
		<pubDate>Fri, 20 Aug 2010 08:33:28 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[factory reset]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[nokia 3100]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[wipe]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=428</guid>
		<description><![CDATA[Some useful sites for factory reset of old nokia phones. I am normally reluctant posting up my IMEI code but this site actually worked when trying to reset an old Nokia 3100. http://nfader.su/ and http://www.bhatt.id.au/blog/nokia-mobile-phone-service-codes-activate-hidden-features/]]></description>
			<content:encoded><![CDATA[<p>Some useful sites for factory reset of old nokia phones.</p>
<p>I am normally reluctant posting up my IMEI code but this site actually worked when trying to reset an old Nokia 3100.</p>
<p>http://nfader.su/</p>
<p>and</p>
<p>http://www.bhatt.id.au/blog/nokia-mobile-phone-service-codes-activate-hidden-features/</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=428</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Useful Android Applications</title>
		<link>http://blog.phoenixdigital.com/?p=424</link>
		<comments>http://blog.phoenixdigital.com/?p=424#comments</comments>
		<pubDate>Wed, 18 Aug 2010 00:32:39 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=424</guid>
		<description><![CDATA[System Settings Curve Fish &#8211; Widget to put phone in silent/vibrate mode Other Flash Player &#8211; Hi Steve Jobs Admin/Modding Utilities ROM Manager &#8211; Allows quick swapping of firmwares Titanium Backup &#8211; Backup of EVERYTHING (Required Root) Root Explorer &#8211; File Explorer GPS Apps Runkeeper &#8211; Great App for tracking your excercise Games/Entertainment Unblock Me [...]]]></description>
			<content:encoded><![CDATA[<p><strong>System Settings</strong><br />
<a href="http://www.appbrain.com/app/com.curvefish.widgets.silentmodeonoff">Curve Fish</a> &#8211; Widget to put phone in silent/vibrate mode</p>
<p><strong>Other</strong><br />
<a href="http://www.appbrain.com/app/com.adobe.flashplayer">Flash Player</a> &#8211; Hi Steve Jobs</p>
<p><strong>Admin/Modding Utilities</strong><br />
<a href="http://www.appbrain.com/app/com.koushikdutta.rommanager">ROM Manager</a> &#8211; Allows quick swapping of firmwares<br />
<a href="http://www.appbrain.com/app/com.keramidas.TitaniumBackup">Titanium Backup</a> &#8211; Backup of EVERYTHING (Required Root)<br />
<a href="http://www.appbrain.com/app/com.speedsoftware.rootexplorer">Root Explorer</a> &#8211; File Explorer</p>
<p><strong>GPS Apps</strong><br />
<a href="http://www.appbrain.com/app/com.fitnesskeeper.runkeeper">Runkeeper</a> &#8211; Great App for tracking your excercise</p>
<p><strong>Games/Entertainment</strong><br />
<a href="http://www.appbrain.com/app/com.kiragames.unblockmefree">Unblock Me</a> &#8211; Great Puzzle Game<br />
<a href="http://www.appbrain.com/app/com.galcon.igalcon">Galcon</a> &#8211; Strategy Game (Multiplayer)</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=424</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Visualisation with Javascript or Flash</title>
		<link>http://blog.phoenixdigital.com/?p=420</link>
		<comments>http://blog.phoenixdigital.com/?p=420#comments</comments>
		<pubDate>Wed, 21 Jul 2010 02:37:24 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[HTML & CSS]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=420</guid>
		<description><![CDATA[Great little time line viewer and other cool visualisations. http://www.simile-widgets.org/]]></description>
			<content:encoded><![CDATA[<p>Great little time line viewer and other cool visualisations.</p>
<p><a href="http://www.simile-widgets.org/">http://www.simile-widgets.org/</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=420</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serializing Mail Messages</title>
		<link>http://blog.phoenixdigital.com/?p=416</link>
		<comments>http://blog.phoenixdigital.com/?p=416#comments</comments>
		<pubDate>Tue, 13 Jul 2010 23:23:27 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[C# Programming]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=416</guid>
		<description><![CDATA[Useful classes for serializing mail messages http://nayyeri.net/how-to-serialize-a-mailmessage and http://gopi.codeplex.com/]]></description>
			<content:encoded><![CDATA[<p>Useful classes for serializing mail messages</p>
<p><a href="http://nayyeri.net/how-to-serialize-a-mailmessage">http://nayyeri.net/how-to-serialize-a-mailmessage</a><br />
and<br />
<a href="http://gopi.codeplex.com/">http://gopi.codeplex.com/</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=416</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import/Export MySQL databases and other commands</title>
		<link>http://blog.phoenixdigital.com/?p=412</link>
		<comments>http://blog.phoenixdigital.com/?p=412#comments</comments>
		<pubDate>Wed, 16 Jun 2010 22:18:31 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[MySql]]></category>
		<category><![CDATA[back]]></category>
		<category><![CDATA[create database]]></category>
		<category><![CDATA[import]]></category>
		<category><![CDATA[mysqldump]]></category>
		<category><![CDATA[Restore]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=412</guid>
		<description><![CDATA[Just a quick reminder of how to backup and restore MySQL databases. 1mysqldump --opt -u [user_name] -p [database_name] &#124; gzip &#62; [backup_file].dump.gz To restore 12gzip -d [backup_file].dump.gz mysql [database_name] &#60; [backup_file].dump To create a database 12mysql -u root -p create database [the_database_name]]]></description>
			<content:encoded><![CDATA[<p>Just a quick reminder of how to backup and restore MySQL databases.</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysqldump --opt -u [user_name] -p [database_name] | gzip &gt; [backup_file].dump.gz</div></td></tr></tbody></table></div>
<p>To restore</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gzip -d [backup_file].dump.gz<br />
mysql [database_name] &lt; [backup_file].dump</div></td></tr></tbody></table></div>
<p>To create a database</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">mysql -u root -p<br />
create database [the_database_name]</div></td></tr></tbody></table></div>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=412</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript inArray functionality</title>
		<link>http://blog.phoenixdigital.com/?p=409</link>
		<comments>http://blog.phoenixdigital.com/?p=409#comments</comments>
		<pubDate>Tue, 15 Jun 2010 22:39:27 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[javascript array search]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=409</guid>
		<description><![CDATA[Some useful examples of prototyping functions in javascript. As well as an efficient method of searching the contents of an an array for a particular value. From http://stackoverflow.com/questions/237104/javascript-array-containsobj thanks to Damir. As others have said, the iteration through the array is probably the best way, but it has been proven that decreasing while loop is [...]]]></description>
			<content:encoded><![CDATA[<p>Some useful examples of prototyping functions in javascript. As well as an efficient method of searching the contents of an an array for a particular value. </p>
<p> From <a href="http://stackoverflow.com/questions/237104/javascript-array-containsobj">http://stackoverflow.com/questions/237104/javascript-array-containsobj</a> thanks to <a href="http://stackoverflow.com/users/30968/damir">Damir</a>.</p>
<p>As others have said, the iteration through the array is probably the best way, but it has been proven that decreasing while loop is the fastest way to iterate in JavaScript. So you may want to rewrite your code as follows:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">function contains(a, obj) {<br />
&nbsp; var i = a.length;<br />
&nbsp; while (i--) {<br />
&nbsp; &nbsp; if (a[i] === obj) {<br />
&nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
&nbsp; return false;<br />
}</div></td></tr></tbody></table></div>
<p>Of course, you may as well extend Array prototype:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Array.prototype.contains = function(obj) {<br />
&nbsp; var i = this.length;<br />
&nbsp; while (i--) {<br />
&nbsp; &nbsp; if (this[i] === obj) {<br />
&nbsp; &nbsp; &nbsp; return true;<br />
&nbsp; &nbsp; }<br />
&nbsp; }<br />
&nbsp; return false;<br />
}</div></td></tr></tbody></table></div>
<p>And now you can simply use the following:</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">alert([1, 2, 3].contains(2)); // =&gt; true<br />
alert([1, 2, 3].contains('2')); // =&gt; false</div></td></tr></tbody></table></div>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=409</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Execution Order</title>
		<link>http://blog.phoenixdigital.com/?p=405</link>
		<comments>http://blog.phoenixdigital.com/?p=405#comments</comments>
		<pubDate>Sun, 06 Jun 2010 23:46:41 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[C# Programming]]></category>
		<category><![CDATA[VB .Net Programming]]></category>
		<category><![CDATA[.net execution order]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=405</guid>
		<description><![CDATA[When a page is loaded the execution order is 12345Page_Init(object sender, EventArgs e) {} Page_Load(object sender, EventArgs e) {} Page_DataBind(object sender, EventArgs e) {} Page_PreRender(object sender, EventArgs e) {} Page_Unload(object sender, EventArgs e) {} http://support.microsoft.com/kb/305141]]></description>
			<content:encoded><![CDATA[<p>When a page is loaded the execution order is</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Page_Init(object sender, EventArgs e) {}<br />
Page_Load(object sender, EventArgs e) {}<br />
Page_DataBind(object sender, EventArgs e) {}<br />
Page_PreRender(object sender, EventArgs e) {}<br />
Page_Unload(object sender, EventArgs e) {}</div></td></tr></tbody></table></div>
<p>http://support.microsoft.com/kb/305141</p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=405</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C# Primitive Types</title>
		<link>http://blog.phoenixdigital.com/?p=402</link>
		<comments>http://blog.phoenixdigital.com/?p=402#comments</comments>
		<pubDate>Thu, 03 Jun 2010 00:01:59 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[C# Programming]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=402</guid>
		<description><![CDATA[Useful lookup of variable types available in c# C# Type .Net Framework (System) type Signed? Bytes Occupied Possible Values sbyte System.Sbyte Yes 1 -128 to 127 short System.Int16 Yes 2 -32768 to 32767 int System.Int32 Yes 4 -2147483648 to 2147483647 long System.Int64 Yes 8 -9223372036854775808 to 9223372036854775807 byte System.Byte No 1 0 to 255 ushort [...]]]></description>
			<content:encoded><![CDATA[<p>Useful lookup of variable types available in c#</p>
<table border="1" cellspacing="0" cellpadding="3" width="90%" align="center">
<tbody>
<tr valign="top">
<td><strong>C# Type</strong></td>
<td><strong>.Net Framework (System) type</strong></td>
<td><strong>Signed?</strong></td>
<td><strong>Bytes Occupied</strong></td>
<td><strong>Possible Values</strong></td>
</tr>
<tr valign="top">
<td>sbyte</td>
<td>System.Sbyte</td>
<td>Yes</td>
<td>1</td>
<td>-128 to 127</td>
</tr>
<tr valign="top">
<td>short</td>
<td>System.Int16</td>
<td>Yes</td>
<td>2</td>
<td>-32768 to 32767</td>
</tr>
<tr valign="top">
<td>int</td>
<td>System.Int32</td>
<td>Yes</td>
<td>4</td>
<td>-2147483648 to 2147483647</td>
</tr>
<tr valign="top">
<td>long</td>
<td>System.Int64</td>
<td>Yes</td>
<td>8</td>
<td>-9223372036854775808 to 9223372036854775807</td>
</tr>
<tr valign="top">
<td>byte</td>
<td>System.Byte</td>
<td>No</td>
<td>1</td>
<td>0 to 255</td>
</tr>
<tr valign="top">
<td>ushort</td>
<td>System.Uint16</td>
<td>No</td>
<td>2</td>
<td>0 to 65535</td>
</tr>
<tr valign="top">
<td>uint</td>
<td>System.UInt32</td>
<td>No</td>
<td>4</td>
<td>0 to 4294967295</td>
</tr>
<tr valign="top">
<td>ulong</td>
<td>System.Uint64</td>
<td>No</td>
<td>8</td>
<td>0 to 18446744073709551615</td>
</tr>
<tr valign="top">
<td>float</td>
<td>System.Single</td>
<td>Yes</td>
<td>4</td>
<td>Approximately ±1.5 x 10<sup>-45 </sup>to ±3.4 x 10<sup>38 </sup>with 7 significant figures</td>
</tr>
<tr valign="top">
<td>double</td>
<td>System.Double</td>
<td>Yes</td>
<td>8</td>
<td>Approximately ±5.0 x 10<sup>-324 </sup>to ±1.7 x 10<sup>308 </sup>with 15 or 16 significant figures</td>
</tr>
<tr valign="top">
<td>decimal</td>
<td>System.Decimal</td>
<td>Yes</td>
<td>12</td>
<td>Approximately ±1.0 x 10<sup>-28 </sup>to ±7.9 x 10<sup>28 </sup>with 28 or 29 significant figures</td>
</tr>
<tr valign="top">
<td>char</td>
<td>System.Char</td>
<td>N/A</td>
<td>2</td>
<td>Any Unicode character (16 bit)</td>
</tr>
<tr valign="top">
<td>bool</td>
<td>System.Boolean</td>
<td>N/A</td>
<td>1 / 2</td>
<td>true or false</td>
</tr>
</tbody>
</table>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=402</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript escape all single and double quotes</title>
		<link>http://blog.phoenixdigital.com/?p=395</link>
		<comments>http://blog.phoenixdigital.com/?p=395#comments</comments>
		<pubDate>Mon, 31 May 2010 05:56:26 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[double quote]]></category>
		<category><![CDATA[escape]]></category>
		<category><![CDATA[global replace]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[replace all]]></category>
		<category><![CDATA[single quote]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=395</guid>
		<description><![CDATA[Global replace of &#8216;s and or &#8220;s 12&#160; &#160; value = value.replace(/\'/g, &#34;&#38;#39;&#34;); &#160; &#160; value = value.replace(/\&#34;/g, &#34;&#38;#34;&#34;);]]></description>
			<content:encoded><![CDATA[<p>Global replace of &#8216;s and or &#8220;s</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; value = value.replace(/\'/g, &quot;&amp;#39;&quot;);<br />
&nbsp; &nbsp; value = value.replace(/\&quot;/g, &quot;&amp;#34;&quot;);</div></td></tr></tbody></table></div>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=395</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrieve rows where count of linked items greater than zero</title>
		<link>http://blog.phoenixdigital.com/?p=390</link>
		<comments>http://blog.phoenixdigital.com/?p=390#comments</comments>
		<pubDate>Sun, 30 May 2010 23:57:44 +0000</pubDate>
		<dc:creator>phoenixdigital</dc:creator>
				<category><![CDATA[MSSQL]]></category>
		<category><![CDATA[count linked table]]></category>
		<category><![CDATA[linked table]]></category>
		<category><![CDATA[most recent]]></category>

		<guid isPermaLink="false">http://blog.phoenixdigital.com/?p=390</guid>
		<description><![CDATA[Say you have two tables where one is linked to the other by it&#8217;s ID or CODE and you only want to retrieve a list of Table1 items which have linked Table2 items. You also want to get the count of Table2 items for each. Table1 id(int) title(varchar) another_id(int) Table2 id(int) table1_id(int) title(varchar) date_added(date) 123456SELECT [...]]]></description>
			<content:encoded><![CDATA[<p>Say you have two tables where one is linked to the other by it&#8217;s ID or CODE and you only want to retrieve a list of Table1 items which have linked Table2 items. You also want to get the count of Table2 items for each.</p>
<p>Table1<br />
id(int)<br />
title(varchar)<br />
another_id(int)</p>
<p>Table2<br />
id(int)<br />
table1_id(int)<br />
title(varchar)<br />
date_added(date)</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT t1.id, t1.title, count(t2.id) <br />
FROM Table1 t1<br />
JOIN Table2 t2 ON t2.table1_id = t1.id<br />
WHERE t1.another_id = 32<br />
GROUP BY t1.code, t1.title<br />
HAVING count(t2.id) &gt; 0</div></td></tr></tbody></table></div>
<p>Now say you want a list of Table1 with the most recent Table2 item ONLY</p>
<div class="codecolorer-container text mac-classic" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">SELECT &nbsp; &nbsp; &nbsp; t1.*, t2.*<br />
FROM &nbsp; &nbsp; &nbsp; &nbsp; Table1 t1<br />
INNER JOIN &nbsp; Table2 t2 <br />
ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t2.table1_id = t1.id<br />
LEFT JOIN &nbsp; &nbsp;Table2 t2later<br />
ON &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t2.table1_id = t2later.table1_id<br />
AND &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;t2later.date_added &gt; t2.date_added<br />
WHERE &nbsp; &nbsp; &nbsp; &nbsp;t2later.table1_id is null</div></td></tr></tbody></table></div>
<p><a hef="http://stackoverflow.com/questions/1819003/sql-join-only-select-top-row-from-2nd-table">Ref</a></p>
<!-- PHP 5.x -->]]></content:encoded>
			<wfw:commentRss>http://blog.phoenixdigital.com/?feed=rss2&amp;p=390</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
