Re: Doubt about join queries

From: Michael Nolan <htfoot(at)gmail(dot)com>
To: jc_mich <juan(dot)michaca(at)paasel(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Doubt about join queries
Date: 2009-04-21 16:41:57
Message-ID: 4abad0eb0904210941y7c251029w781c01aa55cd7b43@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Apr 21, 2009 at 12:04 PM, jc_mich <juan(dot)michaca(at)paasel(dot)com> wrote:

>
> The problem is not the formula, the problem is the join. I've summarized it
> because is a large formula and I've got right results
>
>
You're quite correct that the problem is the join, because neither of the
examples you gave have any code to limit the number of store records
returned.

You may need to include something like the following code fragment. (I'm
using a 'distance' formula as a proxy for the latitude/longitude formula.)

where store_no = (select store_no from store order by
distance(store,customer) limit 1)
--
Mike Nolan

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Worley 2009-04-21 16:52:12 COPY 'invalid byte sequence for encoding "UTF8": 0xff'
Previous Message jc_mich 2009-04-21 16:04:29 Re: Doubt about join queries