<?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[Left join]]></title><description><![CDATA[<h2>Salve a tutti, spiego in sintesi il problema:<br />
tabella 1 "utente"</h2>
<p dir="auto">IDUtente<br />
Nome<br />
RIDRegione</p>
<h2>tabella 2 "regione"</h2>
<p dir="auto">IDRgione<br />
Regione</p>
<p dir="auto">Ho utilizzato la seguente query:<br />
SELECT r.Regione, count( u.RIDRegione ) AS totale<br />
FROM utente AS u LEFT JOIN regione AS r ON u.RIDRegione = r.IDRegione<br />
WHERE u.IDUtente &gt;1<br />
GROUP BY <code>RIDRegione</code><br />
ORDER BY totale DESC</p>
<p dir="auto">Vorrei visualizzare tutte le regioni, con accanto il numero totale di relativi iscritti. Sono riuscito a visualizzare solo le regioni che hanno occorrenza nella tabella "utente", ma non riesco a visualizzare le restanti regioni con accanto 0 come risultato.<br />
Potete aiutarmi?<br />
Grazie in anticipo</p>
]]></description><link>https://dev.connect.gt/topic/126726/left-join</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 08:08:48 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/126726.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 May 2010 10:50:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Left join on Mon, 03 May 2010 15:50:15 GMT]]></title><description><![CDATA[<p dir="auto">A posto, la query è questa:</p>
<p dir="auto">SELECT r.Regione AS reg, count( u.RIDRegione ) AS totale<br />
FROM utente AS u<br />
RIGHT JOIN regione AS r ON u.RIDRegione = r.IDRegione<br />
WHERE r.Regione != 'Non definita'<br />
GROUP BY <code>Regione</code><br />
ORDER BY totale DESC</p>
<p dir="auto">Grazie del tuo aiuto</p>
]]></description><link>https://dev.connect.gt/post/908469</link><guid isPermaLink="true">https://dev.connect.gt/post/908469</guid><dc:creator><![CDATA[huck]]></dc:creator><pubDate>Mon, 03 May 2010 15:50:15 GMT</pubDate></item><item><title><![CDATA[Reply to Left join on Mon, 03 May 2010 15:34:16 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><strong>Thedarkita</strong></p>
<p dir="auto">Ciao Huck,</p>
<p dir="auto">devi invertire le tabelle nelle query, facendo from regione e dopo un join con gli utenti.</p>
</blockquote>
<p dir="auto">Intanto grazie,<br />
funziona, ma ne visualizza solo una di quelle non legate alla tabella utenti, la prima che trova e poi basta, sai come mai?</p>
]]></description><link>https://dev.connect.gt/post/908468</link><guid isPermaLink="true">https://dev.connect.gt/post/908468</guid><dc:creator><![CDATA[huck]]></dc:creator><pubDate>Mon, 03 May 2010 15:34:16 GMT</pubDate></item><item><title><![CDATA[Reply to Left join on Mon, 03 May 2010 14:44:59 GMT]]></title><description><![CDATA[<p dir="auto">Ciao Huck,</p>
<p dir="auto">devi invertire le tabelle nelle query, facendo from regione e dopo un join con gli utenti.</p>
]]></description><link>https://dev.connect.gt/post/908445</link><guid isPermaLink="true">https://dev.connect.gt/post/908445</guid><dc:creator><![CDATA[thedarkita]]></dc:creator><pubDate>Mon, 03 May 2010 14:44:59 GMT</pubDate></item></channel></rss>