<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Select sum]]></title><description><![CDATA[<p dir="auto">Salve ragazzi, qualcuno avrebbe un suggerimento per fare la somma di una colonna della tabella con numeri positivi e negativi?<br />
Ad esempio se trova 10, 30, -5 = 35</p>
<p dir="auto">Al momento sto usando questa...ma non funziona!!!!</p>
<pre><code class="language-php">$sql = "SELECT SUM(totale),data,anno FROM acquisti"
                ." where data like '%/01/$anno'"
                ."GROUP BY anno";
        $gennaio = mysql_result(mysql_query($sql),0);
</code></pre>
]]></description><link>https://dev.connect.gt/topic/171102/select-sum</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 19:44:45 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/171102.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 May 2012 16:33:48 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Select sum on Tue, 15 May 2012 18:08:03 GMT]]></title><description><![CDATA[<p dir="auto">Sum conteggia anche i negativi nella somma se hai -2, -8, 10, 2 ti restituisce 2 come risultato la query.</p>
]]></description><link>https://dev.connect.gt/post/1069028</link><guid isPermaLink="true">https://dev.connect.gt/post/1069028</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Tue, 15 May 2012 18:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to Select sum on Tue, 15 May 2012 13:58:41 GMT]]></title><description><![CDATA[<p dir="auto">...scusa cosa intendi per condizione questa: where data like '%/01/$anno' ?<br />
poi scusa non vorrei essermi espresso male per somma intendevo, si la somma de positivi ma anche la sottrazione dei negati!!!</p>
]]></description><link>https://dev.connect.gt/post/1069029</link><guid isPermaLink="true">https://dev.connect.gt/post/1069029</guid><dc:creator><![CDATA[peterminnow]]></dc:creator><pubDate>Tue, 15 May 2012 13:58:41 GMT</pubDate></item><item><title><![CDATA[Reply to Select sum on Tue, 15 May 2012 11:33:50 GMT]]></title><description><![CDATA[<p dir="auto">Ciao peterminnow,<br />
sum fà esattamente quello che chiedi, probabilmente l'errore deriva dalla condizione che hai messo.</p>
]]></description><link>https://dev.connect.gt/post/1069027</link><guid isPermaLink="true">https://dev.connect.gt/post/1069027</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Tue, 15 May 2012 11:33:50 GMT</pubDate></item></channel></rss>