is grouping over many columns avoidable?

Поиск
Список
Период
Сортировка
От Holger Klawitter
Тема is grouping over many columns avoidable?
Дата
Msg-id 3A801B50.C52445EE@klawitter.de
обсуждение исходный текст
Список pgsql-general
Hi there,

I would like to do a query in order to retrieve a complete row
of a table maching a number of requirements being stored
in another table. The best I could think of was:

select
    x.id, x.1, x.2, ..., x.30
from
    x, y
where
    x.id = y.id and x.name like 'bla%' (y.attr=val1 or y.attr=val2)
group by
    x.id, x.1, x.2, ..., x.30
having
    count(*) = 2
order by
    x.value desc

The grouping looks pretty stupid, is there any faster way to
write a query like that (using 'in' and a subselect to grab the
ids from x made the program 10 times slower...)

With kind regards / Mit freundlichem Gruß
    Holger Klawitter
--
Holger Klawitter
holger@klawitter.de                             http://www.klawitter.de

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

Предыдущее
От: "Gregory Wood"
Дата:
Сообщение: Re: Problems with Relationships in SQL7
Следующее
От: The Hermit Hacker
Дата:
Сообщение: Re: 7.1 release date?