This should work too:

$sql = "SELECT rowid FROM numbers WHERE ABS(number - mynumber) <= 10";

-----Original Message-----
From: Chris Anderson [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, July 04, 2001 1:24 PM
To: [EMAIL PROTECTED]; PHP Mailingliste
Subject: Re: [PHP] writing a query that returns similar numbers


Try the LIKE wording in your statement. That should work....I think
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "PHP Mailingliste" <[EMAIL PROTECTED]>
Sent: Wednesday, July 04, 1979 12:48 PM
Subject: [PHP] writing a query that returns similar numbers


> I have a database with numbers in one of the tables I'd like to ask 
> mysql
to
> renturn all numbers with say 10 of mynumber
>
> Sort of like this:
>
> $sql = "SELECT rowid FROM numbers WHERE (mynumer is within 10 of 
> number)";
>
>
> but I've gotten stuck do I have to do this:
>
>
> $sql = "SELECT rowid FROM numbers WHERE (((mynumer+10) < number) AND
> (mynumer-10) > number) )";
>
> it seems kinda wordy ...
>
> Susan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED] To 
> contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to