<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sugarlabs.org/index.php?action=history&amp;feed=atom&amp;title=Activity_Library%2FDevel%2FQueries</id>
	<title>Activity Library/Devel/Queries - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sugarlabs.org/index.php?action=history&amp;feed=atom&amp;title=Activity_Library%2FDevel%2FQueries"/>
	<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activity_Library/Devel/Queries&amp;action=history"/>
	<updated>2026-04-12T19:10:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.sugarlabs.org/index.php?title=Activity_Library/Devel/Queries&amp;diff=25637&amp;oldid=prev</id>
		<title>Dfarning: initial content</title>
		<link rel="alternate" type="text/html" href="https://wiki.sugarlabs.org/index.php?title=Activity_Library/Devel/Queries&amp;diff=25637&amp;oldid=prev"/>
		<updated>2009-04-06T01:02:30Z</updated>

		<summary type="html">&lt;p&gt;initial content&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Useful SQL Queries =&lt;br /&gt;
&lt;br /&gt;
=== Add-on Count ===&lt;br /&gt;
Retrieves the number of add-ons that support Firefox, are public, sandboxed, or nominated, and are active.&lt;br /&gt;
&lt;br /&gt;
  select count(*) from addons inner join versions on versions.id=(select id from versions where versions.addon_id=addons.id order by id desc limit 1) inner join applications_versions on applications_versions.version_id=versions.id where addons.inactive=0 and addons.status in (1,3,4) and applications_versions.application_id=1;&lt;br /&gt;
&lt;br /&gt;
=== Listing of all 3.0 Add-ons without 3.1 compatibility ===&lt;br /&gt;
Also used for a mail merge spreadsheet, hence the inclusion of developer contact info.&lt;br /&gt;
&lt;br /&gt;
  select a.addon_id, translations.localized_string, sum(count), compat.topver, users.firstname, users.lastname, users.email from update_counts a join (select a.id, a.supportemail, a.name, max(e.version) as topver from addons a, versions c, applications_versions d, appversions e where a.id = c.addon_id and c.id=d.version_id and d.max = e.id and a.addontype_id =1 and d.application_id = 1 and e.version &amp;gt;= 3.0 group by a.id) as compat on (compat.id = a.addon_id) join translations on (translations.id = compat.name) join addons_users on (addons_users.addon_id = a.addon_id) join users on (addons_users.user_id = users.id) where date = &amp;#039;2009-01-14&amp;#039; and compat.topver &amp;lt; 3.1 and translations.locale = &amp;#039;en-us&amp;#039; group by 1 order by 3 desc&lt;br /&gt;
&lt;br /&gt;
=== Listing of all Featured/Category Recommended addons ===&lt;br /&gt;
Used to output a listing of all Featured and Category Recommended addons, with an outer join to show features.id.  If features.id = null then the addon is only category recommended and not featured.&lt;br /&gt;
&lt;br /&gt;
  select a.id, b.localized_string, b2.localized_string, averagerating,totalreviews, max(e.version), features.id from (addons a, translations b, translations b2, versions c, applications_versions d, appversions e, addons_tags f, tags g, (select id from addons where id in (select addon_id from features) or id in (select addon_id from addons_tags where feature=1)) as h, (select tag_id from addons_tags where feature=1) as i) left join features on (a.id = features.addon_id) where a.id = h.id and a.id=f.addon_id and f.tag_id = g.id and g.name = b2.id and b2.locale = &amp;#039;en-us&amp;#039; and g.id = i.tag_id and d.max=e.id and a.id = c.addon_id and c.id=d.version_id and a.name = b.id and b.locale = &amp;#039;en-US&amp;#039; and a.addontype_id =1 and d.application_id = 1 group by 1 order by sum(weeklydownloads) desc&lt;/div&gt;</summary>
		<author><name>Dfarning</name></author>
	</entry>
</feed>