<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Forum PostgreSQL - Zmiana wartości podczas select "w locie"]]></title>
		<link>https://forum.postgresql.org.pl/viewtopic.php?id=1453</link>
		<description><![CDATA[Najświeższe odpowiedzi w Zmiana wartości podczas select "w locie".]]></description>
		<lastBuildDate>Fri, 08 Feb 2013 07:40:43 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Odp: Zmiana wartości podczas select "w locie"]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=3889#p3889</link>
			<description><![CDATA[Super - działa - o to mi chodziło :-)]]></description>
			<author><![CDATA[dummy@example.com (tomek)]]></author>
			<pubDate>Fri, 08 Feb 2013 07:40:43 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=3889#p3889</guid>
		</item>
		<item>
			<title><![CDATA[Odp: Zmiana wartości podczas select "w locie"]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=3888#p3888</link>
			<description><![CDATA[Ad 1 Musisz reagować na wartość null i zamienić ją na pusty ciąg można to zrobić tak:
select 'asd' || coalesce(null,'') || '123'
lub uzywając funkcji case odpowiednik IF
select 'asd' || case when pole is null then '' else pole end || '123' from (select null::varchar as pole) d

Ad 2 tu masz drugi sposób zastosowania funkcji case

select 'Widzę ' || case pole when 1 then 'jednego kota' 
                             when 2 then 'dwa koty'
                             when 3 then 'trzy koty'
                             when 4 then 'cztery koty'
                             when 5 then 'pięć kotów'
                             when 6 then 'sześć kotów'
                             when 7 then 'siedem kotów'
                             when 8 then 'osiem kotów'
                             when 9 then 'dziewięć kotów'
                             else 'dużo kotów' end||' i burka w łatki' as pole_tekstowe
        ,pole
 from generate_series(1,10,1) pole]]></description>
			<author><![CDATA[dummy@example.com (c_michal)]]></author>
			<pubDate>Thu, 07 Feb 2013 20:16:36 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=3888#p3888</guid>
		</item>
		<item>
			<title><![CDATA[Odp: Zmiana wartości podczas select "w locie"]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=3887#p3887</link>
			<description><![CDATA[Jak zauważyłeś null to nie to samo co ''. Nie za bardzo rozumiem po co Ci ta konkatenacja z nullem.]]></description>
			<author><![CDATA[dummy@example.com (rski)]]></author>
			<pubDate>Thu, 07 Feb 2013 18:39:50 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=3887#p3887</guid>
		</item>
		<item>
			<title><![CDATA[Zmiana wartości podczas select "w locie"]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=3879#p3879</link>
			<description><![CDATA[1)  -----------------------------------------------

[code]select 'asd' || '' || '123'[/code]
-> ok, mam wiersz: 'asd123'

ale:
[code]select 'asd' || null || '123'[/code]
-> nie mam ani jednego wiersza

próbowałem:
[code]select 'asd' || text(null) || '123'[/code]
-> ale też nie mam wiersza.

Jest jakiś sposób żeby to zrobić?

1)  -----------------------------------------------


2)  -----------------------------------------------

Czy można w jakiś sposób:
[code]select coś_tam 2;[/code]
abym w wyniku dostał wiersz z dwójką zamienioną na string np:
-> "dwa koty"

2)  -----------------------------------------------]]></description>
			<author><![CDATA[dummy@example.com (tomek)]]></author>
			<pubDate>Thu, 07 Feb 2013 14:38:00 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=3879#p3879</guid>
		</item>
	</channel>
</rss>
