is grouping over many columns avoidable? - Mailing list pgsql-general

From Holger Klawitter
Subject is grouping over many columns avoidable?
Date
Msg-id 3A801B50.C52445EE@klawitter.de
Whole thread Raw
List 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 by date:

Previous
From: "Gregory Wood"
Date:
Subject: Re: Problems with Relationships in SQL7
Next
From: The Hermit Hacker
Date:
Subject: Re: 7.1 release date?