Search Postgresql Archives

Re: Doubt about join queries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux