Searching for results with an unknown amount of data

Поиск
Список
Период
Сортировка
От DownLoad X
Тема Searching for results with an unknown amount of data
Дата
Msg-id BAY101-F2270E5778C3FE6208B3501FCA30@phx.gbl
обсуждение исходный текст
Ответы Re: Searching for results with an unknown amount of data  ("Thomas F. O'Connell" <tfo@sitening.com>)
Re: Searching for results with an unknown amount of data  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-sql
Hi,

I've got two tables, A and B, the first one containing columns

A_ID | info

where A_ID is primary, so that this table stores various information about 
an object, and the second containing columns

A_ID | property

where property is an integer referring to a particular property that an 
object may possess.  I've seperated these into two tables so that an object 
may have several (ie an unknown number of) properties.

Now, I want to find all objects that have at most properties 1,2,3, say (so 
something with (1,2) is okay, as is (1,2,3)). I can't see a way to do this 
-- can anyone help?
Also, what if I want to find all the objects possessing properties 4,5,6, as 
well as possibly other things? I've done it with nested SELECTs (constructed 
programmatically), but I think this is quite slow and not a very pleasing 
solution.

Obviously, both these things will need to be done for an arbitrary list of 
integers.

Thanks,
DL




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

Предыдущее
От: "Antony Sohal"
Дата:
Сообщение: Weird Trigger Behaviour using IF ... THEN ... ESLEIF... THEN... ELSEIF... THEN ... ELSE ... END IF;
Следующее
От: "Robert D. Kennedy"
Дата:
Сообщение: Table Constraint CHECK(SELECT()) alternative?