<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: FAQ and Help Desk</title>
	<atom:link href="http://techmanthan.wordpress.com/faq-and-help-desk/feed/" rel="self" type="application/rss+xml" />
	<link>http://techmanthan.wordpress.com</link>
	<description>"Lets share knowledge..."</description>
	<lastBuildDate>Wed, 16 Jul 2008 18:50:25 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Dhaval</title>
		<link>http://techmanthan.wordpress.com/faq-and-help-desk/#comment-236</link>
		<dc:creator>Dhaval</dc:creator>
		<pubDate>Sat, 08 Sep 2007 09:18:50 +0000</pubDate>
		<guid isPermaLink="false">http://techmanthan.wordpress.com/faq-and-help-desk/#comment-236</guid>
		<description>Hi Sandeep,

Irequire your help in the following query as to how to optimize it

update spool_info set 
weight = (select weight as total_weight from 
	  (
	   SELECT fabshopno,sum(ALLOC_QTY* b.WEIGHT_KG) as weight
 	 	FROM SPOOL_MTO a, WEIGHT_SURF_AREA b 
 		where  a.fabshopno in 
          (select fabshopno from spool_mto where material_code  &#039;PSH20A0D&#039;)  and a.MATERIAL_CODE = b.MATCODE and a.SIZE1=b.SIZE1 and a.SIZE2=b.SIZE2 group by a.fabshopno
 	   ) where fabshopno = spool_info.fabshopno
	  )
where spool_info.fabshopno in  
(select fabshopno from spool_mto where material_code = &#039;PSH20A0D&#039;)

Here if you see the following query is repeated twice:

(select fabshopno from spool_mto where material_code = &#039;PSH20A0D&#039;)

My question is to how to remove the above query in the nested inner query of weight.</description>
		<content:encoded><![CDATA[<p>Hi Sandeep,</p>
<p>Irequire your help in the following query as to how to optimize it</p>
<p>update spool_info set<br />
weight = (select weight as total_weight from<br />
	  (<br />
	   SELECT fabshopno,sum(ALLOC_QTY* b.WEIGHT_KG) as weight<br />
 	 	FROM SPOOL_MTO a, WEIGHT_SURF_AREA b<br />
 		where  a.fabshopno in<br />
          (select fabshopno from spool_mto where material_code  &#8216;PSH20A0D&#8217;)  and a.MATERIAL_CODE = b.MATCODE and a.SIZE1=b.SIZE1 and a.SIZE2=b.SIZE2 group by a.fabshopno<br />
 	   ) where fabshopno = spool_info.fabshopno<br />
	  )<br />
where spool_info.fabshopno in<br />
(select fabshopno from spool_mto where material_code = &#8216;PSH20A0D&#8217;)</p>
<p>Here if you see the following query is repeated twice:</p>
<p>(select fabshopno from spool_mto where material_code = &#8216;PSH20A0D&#8217;)</p>
<p>My question is to how to remove the above query in the nested inner query of weight.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
