In the last episode (Jul 23), Jan Peuker said:
> Dan Nelson wrote:
> > So what you really want is
> >
> > CREATE TEMPORARY TABLE tmp
> > SELECT code FROM mytable WHERE zip < 12345 ORDER BY zip DESC LIMIT 5;
> > INSERT INTO tmp
> > SELECT code FROM mytable WHERE zip = 12345;
> > INSERT INTO tmp
>
But now I think it's the only way.
jan
- Original Message -
From: "Dan Nelson" <[EMAIL PROTECTED]>
To: "Jan Peuker" <[EMAIL PROTECTED]>
Cc: "Gurhan Ozen" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, July 22, 2002 11:35
In the last episode (Jul 22), Jan Peuker said:
> What I want to do is, select the 10(say, a value) nearest values to a
> given number. The easiest way would be "near 5" shows 1..10. The
> problem is, the number should affect rows, not values, because values
> are not unique nor in order. What I wa
gits or you can add 0's on the end
of your 5 digit ZIP's with RPAD().
Gordon Bruce
Interstate Software
A MySQL Training & Consulting Partner
> -Original Message-
> From: Jan Peuker [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 12:54 PM
> To: Gurhan Ozen
It isn't in one statement, but what about, after you get your zip code
select * from table where zip < yourzip order by zip desc limit 5
select * from table where zip > yourzip order by zip limit 5
On Monday, July 22, 2002, at 12:53 PM, Jan Peuker wrote:
> Hi,
>
> sorry for my bad earlier exp
L PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, July 22, 2002 1:53 PM
Subject: Re: Surrounding Rows
> Hi,
>
> sorry for my bad earlier explanation.
> What I want to do is, select the 10(say, a value) nearest values to a
given
> number. The easiest way would be "near
very safe.
Thanks a lot,
jan
- Original Message -
From: "Gurhan Ozen" <[EMAIL PROTECTED]>
To: "Jan Peuker" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, July 22, 2002 7:39 PM
Subject: Re: Surrounding Rows
> Hi,
> Can you please explain
Hi,
Can you please explain what is the algorithm here? Say you have zip code
12345, do you need all rows thats have zipcodes between 12340 and 12350, and
vice versa?
We can't help without knowing what do you mean by "surrounding" .
Gurhan
- Original Message -
From: "Jan Peuker" <[EMAIL