Re: Doubt about join queries - Mailing list pgsql-general

From Michael Nolan
Subject Re: Doubt about join queries
Date
Msg-id 4abad0eb0904210941y7c251029w781c01aa55cd7b43@mail.gmail.com
Whole thread Raw
In response to Re: Doubt about join queries  (jc_mich <juan.michaca@paasel.com>)
Responses Re: Doubt about join queries
List pgsql-general


On Tue, Apr 21, 2009 at 12:04 PM, jc_mich <juan.michaca@paasel.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


pgsql-general by date:

Previous
From: Mikko
Date:
Subject: Re: trouble with to_char('L')
Next
From: Alvaro Herrera
Date:
Subject: Re: trouble with to_char('L')