place condition in the read or in the code?
<p>I am checking if an item has a linked item in the database but cant decide where to put the condition. </p>

<p>option one: place the condition in the database read statement.</p>

<pre><code>select * from item where id = id. 
</code></pre>

<p>Option two check afterwards in code.</p>

<pre><code>temp =  select * from item

for(i = 0; i &lt;sizeof(temp); i++;
{
if(id = temp.id)
{do stuff}
}
</code></pre>

<p>Is there a significant difference between the two ? </p>

<p>note code sample probably contains tons of errors, is for explanation purpose only. </p>
