Query, view join question.

Поиск
Список
Период
Сортировка
От Joost Kraaijeveld
Тема Query, view join question.
Дата
Msg-id A3D1526C98B7C1409A687E0943EAC41001EB24@obelix.askesis.nl
обсуждение исходный текст
Ответы Re: Query, view join question.  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Query, view join question.  (vhikida@inreach.com)
Список pgsql-general
Hi all,

I have 2 tables:

table1 with the columns objectid, refobjectid, commonvaluecol  and value1.
table2 with the columns objectid, refobjectid, commonvaluecol  and value2.

A "select * from table2 where commonvaluecol = 123 and  value2 > 0" returns no rows.

I create a view:

create view miracle as
select table1.objectid, table1.value1, table1.commonvalue, table1.refobjectid, table2.value2
from table1 joing table2 on table1.refobjectid = table2.refobjectid
where commonvaluecol = 123

Than I do a "select * from miracle where commonvaluecol = 123 and  value2 > 0"

This query returns many rows. (How) Is this possible?

Groeten,

Joost Kraaijeveld
Askesis B.V.
Molukkenstraat 14
6524NB Nijmegen
tel: 024-3888063 / 06-51855277
fax: 024-3608416
e-mail: J.Kraaijeveld@Askesis.nl
web: www.askesis.nl

В списке pgsql-general по дате отправления:

Предыдущее
От: "Robin M."
Дата:
Сообщение: unsubscribe
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: Happiness is a cross database link...