 




<?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: SQL sub query or where exists</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/sql-sub-query-or-where-exists/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-sub-query-or-where-exists/</link>
	<description></description>
	<lastBuildDate>Thu, 23 May 2013 13:24:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-sub-query-or-where-exists/#comment-88659</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Thu, 24 Feb 2011 16:42:59 +0000</pubDate>
		<guid isPermaLink="false">#comment-88659</guid>
		<description><![CDATA[No apology necessary, we are here to help.  That was just a suggestion, that will make your job easier.

You might want to post your original query again using the editor&#039;s &quot;code&quot; tool, and your tables&#039; structure.  Maybe more help can be provided with that information.]]></description>
		<content:encoded><![CDATA[<p>No apology necessary, we are here to help.  That was just a suggestion, that will make your job easier.</p>
<p>You might want to post your original query again using the editor&#8217;s &#8220;code&#8221; tool, and your tables&#8217; structure.  Maybe more help can be provided with that information.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bartbart</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-sub-query-or-where-exists/#comment-88648</link>
		<dc:creator>bartbart</dc:creator>
		<pubDate>Thu, 24 Feb 2011 14:33:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-88648</guid>
		<description><![CDATA[Understood.
Sorry for the troubles. 
I changed the &quot;and&quot;s to &quot;or&quot; because I thought it would give me the data if any of the fields are not equal to &quot;0&quot;. Bases upon the &quot;and&quot;, it is my understanding that all conditions must be met when I only care if one of the conditions are met.
I have reviewed a few tutorials but it appears that as you suggest I need to do it again.
Thanks again and I apologize for the inconvenience]]></description>
		<content:encoded><![CDATA[<p>Understood.<br />
Sorry for the troubles.<br />
I changed the &#8220;and&#8221;s to &#8220;or&#8221; because I thought it would give me the data if any of the fields are not equal to &#8220;0&#8243;. Bases upon the &#8220;and&#8221;, it is my understanding that all conditions must be met when I only care if one of the conditions are met.<br />
I have reviewed a few tutorials but it appears that as you suggest I need to do it again.<br />
Thanks again and I apologize for the inconvenience</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: carlosdl</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-sub-query-or-where-exists/#comment-88646</link>
		<dc:creator>carlosdl</dc:creator>
		<pubDate>Thu, 24 Feb 2011 14:18:52 +0000</pubDate>
		<guid isPermaLink="false">#comment-88646</guid>
		<description><![CDATA[Just to clarify:

&quot;&lt;i&gt;the server I am on is a Windows Server 2003 R2.&lt;/i&gt;&quot;

That is the operating system version, it is not the version of the DBMS.

&lt;i&gt;Wikipedia “SQL:2003 is the fifth revision of the SQL database query language. The latest revision of the standard is SQL:2008.”)&lt;/i&gt;

That is the version/revision of the SQL language.  The SQL standard is implemented (with some limitations and some particular additions) by most database vendors (SQL Server, Oracle, DB2, etc).

SQL Server is not a language, it is a database management system by Microsoft, and as Mrdenny stated, there is no Sql Server 2003.

As for your query, the fact that you tried changing ANDs to ORs denotes that you don&#039;t understand what the suggested query does, and don&#039;t understand how those conditions work in a WHERE clause.  I would seriously recommend looking for a &quot;SQL basics&quot;-like tutorial to learn the basics of WHERE clauses, and only after having a good understanding on the subject, go back to your query and fix it.]]></description>
		<content:encoded><![CDATA[<p>Just to clarify:</p>
<p>&#8220;<i>the server I am on is a Windows Server 2003 R2.</i>&#8221;</p>
<p>That is the operating system version, it is not the version of the DBMS.</p>
<p><i>Wikipedia “SQL:2003 is the fifth revision of the SQL database query language. The latest revision of the standard is SQL:2008.”)</i></p>
<p>That is the version/revision of the SQL language.  The SQL standard is implemented (with some limitations and some particular additions) by most database vendors (SQL Server, Oracle, DB2, etc).</p>
<p>SQL Server is not a language, it is a database management system by Microsoft, and as Mrdenny stated, there is no Sql Server 2003.</p>
<p>As for your query, the fact that you tried changing ANDs to ORs denotes that you don&#8217;t understand what the suggested query does, and don&#8217;t understand how those conditions work in a WHERE clause.  I would seriously recommend looking for a &#8220;SQL basics&#8221;-like tutorial to learn the basics of WHERE clauses, and only after having a good understanding on the subject, go back to your query and fix it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bartbart</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-sub-query-or-where-exists/#comment-88642</link>
		<dc:creator>bartbart</dc:creator>
		<pubDate>Thu, 24 Feb 2011 12:38:20 +0000</pubDate>
		<guid isPermaLink="false">#comment-88642</guid>
		<description><![CDATA[MrDenny.,
Thanks for the reply. You are correct in the fact that I have &quot;a LOT&quot; to learn.

As for the server... not sure what I am looking at but the server I am on is a Windows Server 2003 R2.
Wikipedia &quot;SQL:2003 is the fifth revision of the SQL database query language. The latest revision of the standard is SQL:2008.&quot;)

Thanks again for the info and I have reviewed the code provided. I did run it just to see but I am coming up with a &quot;0&quot;.  Appears the issue is the &quot;AND&quot; statements. I changed the &quot;AND&quot;s to an &quot;OR&quot; and I receive the same results that I had prior to changing the code. The data is correct&lt;b&gt; except&lt;/b&gt; for the fact of the MBSTAT &quot;20&quot;. It pulls all items that have the relationship and not just the ones with the status “20”.

Sorry for the table and column names. It is an ERP system. I didn&#039;t create the database that is for sure

Thanks again and let me know if you have any other ideas.]]></description>
		<content:encoded><![CDATA[<p>MrDenny.,<br />
Thanks for the reply. You are correct in the fact that I have &#8220;a LOT&#8221; to learn.</p>
<p>As for the server&#8230; not sure what I am looking at but the server I am on is a Windows Server 2003 R2.<br />
Wikipedia &#8220;SQL:2003 is the fifth revision of the SQL database query language. The latest revision of the standard is SQL:2008.&#8221;)</p>
<p>Thanks again for the info and I have reviewed the code provided. I did run it just to see but I am coming up with a &#8220;0&#8243;.  Appears the issue is the &#8220;AND&#8221; statements. I changed the &#8220;AND&#8221;s to an &#8220;OR&#8221; and I receive the same results that I had prior to changing the code. The data is correct<b> except</b> for the fact of the MBSTAT &#8220;20&#8243;. It pulls all items that have the relationship and not just the ones with the status “20”.</p>
<p>Sorry for the table and column names. It is an ERP system. I didn&#8217;t create the database that is for sure</p>
<p>Thanks again and let me know if you have any other ideas.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.042 seconds using memcached
Object Caching 309/315 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-23 14:48:41 -->