<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Forum PostgreSQL - Proszę o pomoc]]></title>
	<link rel="self" href="http://forum.postgresql.org.pl/extern.php?action=feed&amp;tid=389&amp;type=atom"/>
	<updated>2010-02-03T15:16:31Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.postgresql.org.pl/viewtopic.php?id=389</id>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1792#p1792"/>
			<content type="html"><![CDATA[No to może jakoś tak, wyszukuje tych co mieli wpis 7 dni temu i na pewno nie mieli wpisu w okresie czasu od '6 dni temu' do dziś
[code]
select * from tabela t1 where lastupdate=now()-interval '7 days' and not exists (select 1 from tabela t2 where lastupdate between now()-interval '6 days' and now() and t1.ID_klient=t2.ID_klient);
[/code]]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2010-02-03T15:16:31Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1792#p1792</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1786#p1786"/>
			<content type="html"><![CDATA[stała zawsze liczona od dzisiejszego dnia ( dziś - 7 dni ) :)]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T08:42:30Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1786#p1786</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1785#p1785"/>
			<content type="html"><![CDATA[No to trochę zmienia postać rzeczy. 7 dni to stała wartość czy może się zmieniać?]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2010-02-02T08:41:36Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1785#p1785</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1784#p1784"/>
			<content type="html"><![CDATA[jeszcze raz potrzebuję wyciągać dane z danego dnia czyli dziś mamy 2 luty daje sobie parametr aby znalazł mi wszystkich którzy 7 dni temu mieli ostatniego zapisa w lastupdate czyli 26 stycznia stąd ten parametr :) a jak szuka mi wszystkich z przed 7 dni zeby wykluczał tch którzy pomimo iż mają zapis z 26 stycznia mają też poźniejsze np z 01.02 żeby wyszukiwał tylko tych którzy mają ostatnią datę w lastupdate jaką ja sobie przyjmę :)]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T08:26:05Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1784#p1784</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1783#p1783"/>
			<content type="html"><![CDATA[??
Ja w zapytaniu zagnieżdżonym napisałęm znak '>' ty napisałeś '=' . 
Najpierw mówisz ze chcesz wpisy z dzisiejsza ostatnia data a w zapytaniu piszesz jakieś '-7 dni'.
No nie kumam.]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2010-02-02T08:16:17Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1783#p1783</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1782#p1782"/>
			<content type="html"><![CDATA[może po D*** dawać że lastupdate jest w timestamp zapisany jako 12-12-2010 01:24:45.123456+01 ??]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T08:13:21Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1782#p1782</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1781#p1781"/>
			<content type="html"><![CDATA[ok lukam jeszcze]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T08:10:35Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1781#p1781</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1780#p1780"/>
			<content type="html"><![CDATA[?! To może zobacz jeszcze raz to co napisałem i sprawdź  czy masz to samo (zwróć uwagę na zapytanie zagnieżdżone).]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2010-02-02T08:05:13Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1780#p1780</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1779#p1779"/>
			<content type="html"><![CDATA[Zrobiłem jak napisałeś ( modyfikując pod moje potrzeby ) i nadal nic nie pojawia się wynik pomimo że jak ręcznie sobie sprawdzę są rekordy spełniające kryterium o którym pisałem w 1 poście :(

select * from kredyty t1 where lastupdate=now() and not exists (select * from kredyty t2 where to_char(lastupdate, 'YYYY-MM-DD'::text) = to_char(('now'::text::date -7)::timestamp with time zone, 'YYYY-MM-DD'::text) and t1.id=t2.id);]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T07:57:30Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1779#p1779</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1778#p1778"/>
			<content type="html"><![CDATA[oznaczenie t1 i t2 mnie zmyliło :P zaraz se czekne :)]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T07:49:35Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1778#p1778</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1777#p1777"/>
			<content type="html"><![CDATA[Tylko że tu operujemy dwa razy na tej samej tabeli :), tej którą zapodałeś w pierwszym poście.]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2010-02-02T07:39:54Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1777#p1777</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1776#p1776"/>
			<content type="html"><![CDATA[Tylko z tego co widzę tu operujemy na dwóch tabelach a ja potrzebuje to zrobić w obrębie jednej]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T07:35:18Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1776#p1776</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Odp: Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1775#p1775"/>
			<content type="html"><![CDATA[cos w tm stylu (z dokladnością do rzutowania pól bo nie wiem jakiego sa typu)
[code]
select * from tabela t1 where lastupdate=now() and not exists (select 1 from tabela t2 where lastupdate>now() and t1.ID_klient=t2.ID_klient);
[/code]]]></content>
			<author>
				<name><![CDATA[rski]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=26</uri>
			</author>
			<updated>2010-02-02T07:23:01Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1775#p1775</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Proszę o pomoc]]></title>
			<link rel="alternate" href="https://forum.postgresql.org.pl/viewtopic.php?pid=1774#p1774"/>
			<content type="html"><![CDATA[Witam wszystkich mam taki o to problem

mam tabelę kredyciki

Id | ID_klient | imie | naziwsko| kredyt | lastupdate
------------------------------------------

i potrzebuję z tej tabelki uzyskać informacje o tym kto np w kolumnie lastupdate ma date 2010-01-25 i nie ma później żadnej innej daty
ponieważ w tej tabeli zapisywane dopisywane rekordy o kredytach i lastupdate pokazuje kiedy był on spłacony jeśli pojawia się po nim następny wpis oznacza to że klient po danej dacie wziął kolejny kredyt a ja potrzebuje wyciągnąć tylko tych którzy w danym dniu mają ostatni zapis w las update i nic poza tym

kobinowałem z

to_char(kredyciki.lastupdate, 'YYYY-MM-DD'::text) = to_char(('now'::text::date -7)::timestamp with time zone, 'YYYY-MM-DD'::text)

ale pokazuje również osoby które mają późniejsze lastupdate a mnie zależy aby mac last update był ten który mnie interesuje a po nim już nic więcej nie wiem jak ugryść ten problem proszę o pomoc]]></content>
			<author>
				<name><![CDATA[szachor]]></name>
				<uri>https://forum.postgresql.org.pl/profile.php?id=1054</uri>
			</author>
			<updated>2010-02-02T06:57:03Z</updated>
			<id>https://forum.postgresql.org.pl/viewtopic.php?pid=1774#p1774</id>
		</entry>
</feed>
