<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - Wybór [pola] sortowania w zależności od spełnionego warunku]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=1456&amp;type=atom"/>
	<updated>2013-02-08T12:02:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=1456</id>
		<entry>
			<title type="html"><![CDATA[Odp: Wybór [pola] sortowania w zależności od spełnionego warunku]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=3891#p3891"/>
			<content type="html"><![CDATA[oczywiście, że można zobacz poniższy przykład (pierwsze będą te rekordy, dla  których pole1 >= pole2)

select * from (
select 1 as pole1 ,2 as pole2 union all
select 4 as pole1 ,1 as pole2 union all
select 4 as pole1 ,3 as pole2 ) dane
order by case when pole1>=pole2 then 0 else 1 end , pole1,pole2]]></content>
			<author>
				<name><![CDATA[c_michal]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=627</uri>
			</author>
			<updated>2013-02-08T12:02:07Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=3891#p3891</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Wybór [pola] sortowania w zależności od spełnionego warunku]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=3890#p3890"/>
			<content type="html"><![CDATA[Czy można zrobić zrobić sortowanie po polu1 lub polu2 w zależności od tego czy spełniony jest jakiś warunek,
obrazowo coś takiego:
[code]order by jakiś warunek wtedy pole1 jakiś warunek wtedy pole 2[/code]
??]]></content>
			<author>
				<name><![CDATA[tomek]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1459</uri>
			</author>
			<updated>2013-02-08T09:52:35Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=3890#p3890</id>
		</entry>
</feed>
