<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - różnica tabel...]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=1928&amp;type=atom"/>
	<updated>2014-01-08T13:10:14Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=1928</id>
		<entry>
			<title type="html"><![CDATA[Odp: różnica tabel...]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=4962#p4962"/>
			<content type="html"><![CDATA[He he w innym poście znalazłem rozwiązanie :)

select obrpuz.id from obrpuz WHERE obrpuz.id NOT IN (SELECT id FROM www_temp_stan WHERE KODINS='460128' and stan>=1 order by id desc) and obrpuz.KODINS='460128' and obrpuz.stan>=1]]></content>
			<author>
				<name><![CDATA[STRATOLINER]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1641</uri>
			</author>
			<updated>2014-01-08T13:10:14Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=4962#p4962</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[różnica tabel...]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=4961#p4961"/>
			<content type="html"><![CDATA[Witam.
To pewnie banał ale już zgłupiałem...
Mam dwie tabele:

SELECT id FROM obrpuz WHERE KODINS='460128' and stan>=1 order by id desc

wynik:
id
78959
75749
71802
71801
64807
59809

oraz
SELECT id FROM www_temp_stan WHERE KODINS='460128' and stan>=1 order by id desc

wynik:
id
75749
71802
71801
64807
59809

Jak widać różnią się rekordem o id=78959.
Chcę wyświetlić różnicę tych tabel czyli tylko rekord o id=78959

Mam sql:

select obrpuz.id
from obrpuz
left join www_temp_stan on obrpuz.id = www_temp_stan.id and obrpuz.kodins = www_temp_stan.kodins
where
obrpuz.kodins = '460128' AND
obrpuz.stan>=1 

wynik:
id
59809
71801
71802
75749
64807
78959

:(

jak na końcu dodam: and obrpuz.id <> www_temp_stan.id
wynik będzie pusty.

Jak wyświetlić tylko rekordy z obrpuz których nie ma w www_temp_stan ?]]></content>
			<author>
				<name><![CDATA[STRATOLINER]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1641</uri>
			</author>
			<updated>2014-01-08T12:58:32Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=4961#p4961</id>
		</entry>
</feed>
