<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Forum PostgreSQL - UPDATE dwoch tabel - co robie nie tak:)]]></title>
		<link>https://forum.postgresql.org.pl/viewtopic.php?id=1485</link>
		<description><![CDATA[Najświeższe odpowiedzi w UPDATE dwoch tabel - co robie nie tak:).]]></description>
		<lastBuildDate>Fri, 12 Apr 2013 13:39:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Odp: UPDATE dwoch tabel - co robie nie tak:)]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4152#p4152</link>
			<description><![CDATA[oba rozwiazania zadzialaly
dziekuje]]></description>
			<author><![CDATA[dummy@example.com (KotonPL)]]></author>
			<pubDate>Fri, 12 Apr 2013 13:39:52 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4152#p4152</guid>
		</item>
		<item>
			<title><![CDATA[Odp: UPDATE dwoch tabel - co robie nie tak:)]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4151#p4151</link>
			<description><![CDATA[update tabela1 as t1
set do_uzupelnienia = t2.uzupelniajace
from tabela2 as t2
where t2.id_wiersza = t1.id_wiersza
and t1.do_uzupelniania is null;]]></description>
			<author><![CDATA[dummy@example.com (depesz)]]></author>
			<pubDate>Fri, 12 Apr 2013 13:05:42 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4151#p4151</guid>
		</item>
		<item>
			<title><![CDATA[Odp: UPDATE dwoch tabel - co robie nie tak:)]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4150#p4150</link>
			<description><![CDATA[Proponuje tak
update tabela1 set do_uzupelnienia = (select uzupelniajace from tabela2 where tabela1.id_wiersza = tabela2.id_wiersza) WHERE tabela1.do_uzupelnienia is null;

Jeśli po update pole tabela1.do_uzupelnienia będzie miało wartość null tzn, że nie masz w tabeli2 wartośći w polu uzupelniajace lub nie ma takiego id_wiersza]]></description>
			<author><![CDATA[dummy@example.com (c_michal)]]></author>
			<pubDate>Fri, 12 Apr 2013 12:38:51 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4150#p4150</guid>
		</item>
		<item>
			<title><![CDATA[UPDATE dwoch tabel - co robie nie tak:)]]></title>
			<link>https://forum.postgresql.org.pl/viewtopic.php?pid=4149#p4149</link>
			<description><![CDATA[kolumny w pierwszej tabeli to id_wiersza, do_uzupelnienia
kolumny w drugiej tabeli to id_wiersza2, uzupelniajace

update tabela1 set do_uzupelnienia = (select uzupelniajace
from tabela2
where
tabela1.id_wiersza = tabela2.id_wiersza
and
tabela1 is null);

pierwsza tabele mam juz czesciowo uzupelniona i chcialbym reszte pustych pol uzupelnic danymi z drugiej tabeli, ale po wykonaniu tej instrukcji tabela1 uzupelnia sie danymi z tabeli drugiej, ale tworza sie puste pola tam gdzie bylo juz uzupelnione pierwotnie - co robie nie tak?:)]]></description>
			<author><![CDATA[dummy@example.com (KotonPL)]]></author>
			<pubDate>Fri, 12 Apr 2013 09:55:21 +0000</pubDate>
			<guid>https://forum.postgresql.org.pl/viewtopic.php?pid=4149#p4149</guid>
		</item>
	</channel>
</rss>
