<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Forum PostgreSQL - Numerowanie/ iterowanie wierszy tabeli]]></title>
		<link>https://forum.postgresql.org.pl/viewtopic.php?id=1888</link>
		<description><![CDATA[Najświeższe odpowiedzi w Numerowanie/ iterowanie wierszy tabeli.]]></description>
		<lastBuildDate>Wed, 02 Oct 2013 11:02:49 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Odp: Numerowanie/ iterowanie wierszy tabeli]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4736#p4736</link>
			<description><![CDATA["window functions", row_number(), dense_rank(), ...
- dzięki :-)]]></description>
			<author><![CDATA[dummy@example.com (tomek)]]></author>
			<pubDate>Wed, 02 Oct 2013 11:02:49 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4736#p4736</guid>
		</item>
		<item>
			<title><![CDATA[Odp: Numerowanie/ iterowanie wierszy tabeli]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4728#p4728</link>
			<description><![CDATA[select termin,row_number() over (order by termin) as lp,
row_number() over (PARTITION BY to_char(termin,'YYYY') ORDER BY termin) as na_raty
from tabela]]></description>
			<author><![CDATA[dummy@example.com (adamleon)]]></author>
			<pubDate>Tue, 01 Oct 2013 11:14:18 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4728#p4728</guid>
		</item>
		<item>
			<title><![CDATA[Odp: Numerowanie/ iterowanie wierszy tabeli]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4727#p4727</link>
			<description><![CDATA[poczytaj o "Window functions", a dokładnie o row_number()]]></description>
			<author><![CDATA[dummy@example.com (c_michal)]]></author>
			<pubDate>Tue, 01 Oct 2013 11:04:15 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4727#p4727</guid>
		</item>
		<item>
			<title><![CDATA[Numerowanie/ iterowanie wierszy tabeli]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4725#p4725</link>
			<description><![CDATA[Mam tabele:

termin
----------------
2011-03-15
2011-06-15
2011-09-15
2011-12-15

2012-03-15
2012-06-15
2012-12-15

2013-02-15
2013-05-15
2013-08-15
2013-11-15
2013-12-30


---------------------------------------------
1.
Chciałbym uzyskać taką tabelę

termin         | lp
----------------------------
2011-03-15 | 1
2011-06-15 | 2
2011-09-15 | 3
2011-12-15 | 4

2012-03-15 | 5
2012-06-15 | 6
2012-12-15 | 7

2013-02-15 | 8
2013-05-15 | 9
2013-08-15 | 10
2013-11-15 | 11
2013-12-30 | 12


------------------------------------------
2.
Chciałbym uzyskać taką tabelę:


termin         | nr_raty
----------------------------
2011-03-15 | 1
2011-06-15 | 2
2011-09-15 | 3
2011-12-15 | 4

2012-03-15 | 1
2012-06-15 | 2
2012-12-15 | 3

2013-02-15 | 1
2013-05-15 | 2
2013-08-15 | 3
2013-11-15 | 4
2013-12-30 | 5



Proszę o wskazówki, nie wiem za bardzo jak do tego podejść.]]></description>
			<author><![CDATA[dummy@example.com (tomek)]]></author>
			<pubDate>Tue, 01 Oct 2013 09:26:09 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4725#p4725</guid>
		</item>
	</channel>
</rss>
