Re: searching array

From: Joe Conway <mail(at)joeconway(dot)com>
To: Matthew Peter <survivedsushi(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: searching array
Date: 2005-10-17 18:28:11
Message-ID: 4353ED3B.1070204@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Matthew Peter wrote:
> Shouldn't >= also return Carols records since she
> contains records GREATER THAN 10000? This is the
> problem I'm having, there's no errors, just no records
> matching the > (gt) part. Only exact matches.

Look again at your query:

SELECT * FROM sal_emp WHERE 10000 >= ALL (pay_by_quarter);

You are asking for matches where 10000 is greater than or equal to all
the elements in the array. In Carol's case 10000 is less than all the
elements -- hence no match.

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2005-10-17 18:28:47 Re: [pgsql-advocacy] Oracle buys Innobase
Previous Message Douglas McNaught 2005-10-17 18:26:43 Re: Problem using start transaction in nested transactions.