<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>select * from depesz; &#187; group by</title>
	<atom:link href="http://www.depesz.com/tag/group-by/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.depesz.com</link>
	<description></description>
	<lastBuildDate>Mon, 07 May 2012 20:34:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Grouping data into time ranges</title>
		<link>http://www.depesz.com/2010/10/22/grouping-data-into-time-ranges/</link>
		<comments>http://www.depesz.com/2010/10/22/grouping-data-into-time-ranges/#comments</comments>
		<pubDate>Fri, 22 Oct 2010 12:27:13 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[timestamp]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1882</guid>
		<description><![CDATA[Today some guy on IRC asked question, which I didn&#8217;t fully understand, but which could (probably) be summarized: how to group data into 5 minute intervals, based on some timestamp column. Well, it seems trivial (as long as you know how to do it), but since he clearly didn&#8217;t know how to do it (or [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/10/22/grouping-data-into-time-ranges/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to group messages into chats?</title>
		<link>http://www.depesz.com/2010/09/12/how-to-group-messages-into-chats/</link>
		<comments>http://www.depesz.com/2010/09/12/how-to-group-messages-into-chats/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 13:13:31 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cte]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[groups]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[rhodiumtoad]]></category>
		<category><![CDATA[window]]></category>
		<category><![CDATA[window functions]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1837</guid>
		<description><![CDATA[My jabber server had the feature, that it logs all messages that got sent through it. This is pretty cool, and useful. And now, i got asked to use it to create list of conversations. What exactly is this? Whenever I send (or receive) something there is record in database with information about which local [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/09/12/how-to-group-messages-into-chats/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Waiting for 9.1 &#8211; Recognize functional dependency on primary keys.</title>
		<link>http://www.depesz.com/2010/08/08/waiting-for-9-1-recognize-functional-dependency-on-primary-keys/</link>
		<comments>http://www.depesz.com/2010/08/08/waiting-for-9-1-recognize-functional-dependency-on-primary-keys/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 20:43:33 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[pg91]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[primary key]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1800</guid>
		<description><![CDATA[Yesterday (August, 7th), Tom Lane committed: Log Message: ----------- Recognize functional dependency on primary keys. This allows a table's other columns to be referenced without listing them in GROUP BY, so long as the primary key column(s) are listed in GROUP BY. &#160; Eventually we should also allow functional dependency on a UNIQUE constraint when [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/08/08/waiting-for-9-1-recognize-functional-dependency-on-primary-keys/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Getting unique elements</title>
		<link>http://www.depesz.com/2010/04/19/getting-unique-elements/</link>
		<comments>http://www.depesz.com/2010/04/19/getting-unique-elements/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 11:46:38 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[aggregate]]></category>
		<category><![CDATA[distinct]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[unique]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1665</guid>
		<description><![CDATA[Let&#8217;s assume you have some simple database with &#8220;articles&#8221; &#8211; each article can be in many &#8220;categories&#8221;. And now you want to get list of all articles in given set of categories. Standard approach: select a.* from articles as a join articles_in_categories as aic on a.id = aic.article_id where aic.category_id in (14,62,70,53,138) Will return duplicated [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2010/04/19/getting-unique-elements/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Tips N&#8217; Tricks &#8211; count of all and just some</title>
		<link>http://www.depesz.com/2008/10/08/tips-n-tricks-count-of-all-and-just-some/</link>
		<comments>http://www.depesz.com/2008/10/08/tips-n-tricks-count-of-all-and-just-some/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 18:10:17 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[nullif]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[tnt]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1293</guid>
		<description><![CDATA[Let&#8217;s assume you have very simple table with users: # \d users Table "public.users" Column &#124; Type &#124; Modifiers -----------+---------+---------------------------------------------------- id &#124; integer &#124; not null default nextval('users_id_seq'::regclass) username &#124; text &#124; not null is_active &#124; boolean &#124; not null default true Indexes: "users_pkey" PRIMARY KEY, btree (id) "users_username_key" UNIQUE, btree (username) And you&#8217;d like [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2008/10/08/tips-n-tricks-count-of-all-and-just-some/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Counting number of distinct elements</title>
		<link>http://www.depesz.com/2008/05/22/counting-number-of-distinct-elements/</link>
		<comments>http://www.depesz.com/2008/05/22/counting-number-of-distinct-elements/#comments</comments>
		<pubDate>Thu, 22 May 2008 15:41:43 +0000</pubDate>
		<dc:creator>depesz</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[distinct]]></category>
		<category><![CDATA[group by]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[surprise]]></category>

		<guid isPermaLink="false">http://www.depesz.com/?p=1210</guid>
		<description><![CDATA[When I was working for one of customers we found some strange thing. We needed to found number of distinct sessions per day. Table layout was very simple: Table "public.some_test_table" Column &#124; Type &#124; Modifiers --------------+------------------------+----------- logdate &#124; date &#124; sessionid &#124; character varying(32) &#124; ... Basically, every session can appear many times during a [...]]]></description>
		<wfw:commentRss>http://www.depesz.com/2008/05/22/counting-number-of-distinct-elements/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

