<?xml version="1.0" encoding="utf-8"?><!-- generator="wordpress/2.1.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: ZenCart Orders Total Weight Query</title>
	<link>http://damonparker.org/blog/2006/11/29/zencart-orders-total-weight-query/</link>
	<description>mental spew</description>
	<pubDate>Wed, 07 Jan 2009 17:31:56 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1.3</generator>

	<item>
		<title>By: mo</title>
		<link>http://damonparker.org/blog/2006/11/29/zencart-orders-total-weight-query/#comment-25858</link>
		<author>mo</author>
		<pubDate>Sun, 02 Dec 2007 17:17:31 +0000</pubDate>
		<guid>http://damonparker.org/blog/2006/11/29/zencart-orders-total-weight-query/#comment-25858</guid>
					<description>your query does not count more than 1 items of the same products
more accurate query should be sth like this:

SELECT op.products_quantity*sum(p.products_weight)
FROM products p JOIN orders_products op
WHERE p.products_id IN (SELECT products_id FROM orders_products WHERE orders_id = 'ORDER_ID')
AND op.orders_id = 'ORDER_ID'</description>
		<content:encoded><![CDATA[<p>your query does not count more than 1 items of the same products<br />
more accurate query should be sth like this:</p>
<p>SELECT op.products_quantity*sum(p.products_weight)<br />
FROM products p JOIN orders_products op<br />
WHERE p.products_id IN (SELECT products_id FROM orders_products WHERE orders_id = &#8216;ORDER_ID&#8217;)<br />
AND op.orders_id = &#8216;ORDER_ID&#8217;</p>
]]></content:encoded>
				</item>
	<item>
		<title>By: damonp</title>
		<link>http://damonparker.org/blog/2006/11/29/zencart-orders-total-weight-query/#comment-25860</link>
		<author>damonp</author>
		<pubDate>Mon, 03 Dec 2007 16:10:31 +0000</pubDate>
		<guid>http://damonparker.org/blog/2006/11/29/zencart-orders-total-weight-query/#comment-25860</guid>
					<description>Good catch!

I updated the original query to avoid confusion.</description>
		<content:encoded><![CDATA[<p>Good catch!</p>
<p>I updated the original query to avoid confusion.</p>
]]></content:encoded>
				</item>
</channel>
</rss>
