|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
MYSQL NOT OPERATOR
I am trying to get the 'NOT' operator to work. I purchased the MYSQL bible and it had a short blurb in there about NOT but that was it.
What I am trying to accomplish is this. I want to do a look up for a range where anything not in that range apears. A NON working Example, IN A PERFECT WORLD WOULD LOOK LIKE THIS: $sql = "SELECT * FROM table WHERE range !> '1' AND range !< '10'"; THE ACTULAY CODE I AM TRYING THAT IS NOT WORKING IS: $sql = "SELECT * FROM table WHERE range NOT (range > '1' AND range < '10')"; I am using MySQL 3.23.56 1. does the NOT operator even work and if so does anyone know for what version? 2. Is there a way to accomplish this with my current version of mysql. Thanks, Steve |
|
#2
|
||||
|
||||
|
RE: MYSQL NOT OPERATOR
Try using NOT BETWEEN:
SELECT * FROM table WHERE range NOT BETWEEN 1 AND 10 |
|
#3
|
|||
|
|||
|
RE: MYSQL NOT OPERATOR
what kind of error do you get?
try Code:
WHERE NOT (range > '1' AND range < '10') Code:
WHERE (range < '1' OR range > '10') Code:
WHERE NOT (range BETWEEN 1 AND 10) |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > MYSQL NOT OPERATOR |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|