On Fri, 27 Dec 2002 13:11:42 -0500, Asendorf, John wrote:
>SELECT Dealers.*, SQRT(POW((2285-Zips.North),2)+POW((4760-Zips.West),2)) AS
>Distance
>FROM Dealers 
>INNER JOIN Zips ON Dealers.Zip = Zips.Zip
>ORDER BY POW((2285-Zips.North),2)+POW((4760-Zips.West)),2)

        Off the top of my head have you tried not calculating the order
by field again?  Something like:

SELECT Dealers.*, POW((2285-Zips.North),2)+POW((4760-Zips.West),2) as
L, SQRT(L) AS Distance
FROM Dealers 
INNER JOIN Zips ON Dealers.Zip = Zips.Zip
ORDER BY L

(or should it be order by Distance?)

 - Steve Yates
 - 62% of those polled felt polls asked trivial questions.

~ Taglines by Taglinator - www.srtware.com ~

sql


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to