Hello, Bryce.
It wasn't supposed to output duplicates.
I have assumed that on the test_attributes u didn't have duplicate records,
i.e.,
you didn't have the same pair (people_id, attribute) more than once... But
it seems you do...
And Hence the duplicate row for Obama .
Why is that?
One person can
It works (with a DISTINCT clause added because of the duplicated row
for Obama). It has a nice clean looking explain plan. It has the
slowest execution time on this sample table (though that might not mean
anything).
SELECT
DISTINCT
person_name
FROM test_people p
JOIN test_attributes a
ON ((
Hi,
This is how I do it, and it runs fast:
select p.*
from test_people p inner join test_attributes a on p.people_id =
a.people_id
where a."attribute" = @firstAttr or a."attribute" = @secondAttr
If you have many attributes to search for you can replace the where part
with
where a."attribut
Howdy, Bryce
Could you please try this out and tell me if it gave what you want.
Best,
Oliveiros
SELECT person_name
FROM test_people p
JOIN test_attributes a
ON ((a.people_id = p.people_id) AND (a."attribute" = @firstAttr))
JOIN test_attributes b
ON ((b."people_id" = p."people_id") AND (b."attri
On Fri, Dec 5, 2008 at 1:51 PM, Mark Roberts
<[EMAIL PROTECTED]> wrote:
>
> On Thu, 2008-12-04 at 13:01 -0500, Sean Davis wrote:
>> I am happy to see NaN and infinity handled in input. I would now like
>> to compute aggregates (avg, min, max, etc) on columns with NaN values
>> in them. The standa
Dear Experts,
I'm looking for a good technique to do "and" searches on one-to-many
joined tables. For example, to find people with both 'dark hair' and
'president':
# select * from test_people join test_attributes using (people_id);
+---+-+---+
| people_id | p
On Thu, 2008-12-04 at 13:01 -0500, Sean Davis wrote:
> I am happy to see NaN and infinity handled in input. I would now like
> to compute aggregates (avg, min, max, etc) on columns with NaN values
> in them. The standard behavior (it appears) is to have the aggregate
> return NaN if the data con