NOT LIKE error

NOT LIKE error

am 24.06.2003 04:31:02 von Rohan Hawthorne

------_=_NextPart_001_01C339F8.A7D8D7F6
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Not sure if this is a bug, but couldn't find any documentation to
explain it - I'm guessing it's standard
SQL for the version I'm on ? (4.0.13)
=20
The 'problem' is that it doesn't return the NULL row with the NOT LIKE
statement.
=20
=20
mysql> describe test_like;
+---------+---------+------+-----+---------+---------------- +
| Field | Type | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+---------------- +
| test_id | int(11) | | PRI | NULL | auto_increment |
| name | text | YES | | NULL | |
+---------+---------+------+-----+---------+---------------- +
2 rows in set (0.00 sec)
=20
mysql> select * from test_like;
+---------+-------+
| test_id | name |
+---------+-------+
| 1 | one |
| 2 | two |
| 3 | NULL |
| 4 | three |
+---------+-------+
4 rows in set (0.00 sec)
=20
mysql> select * from test_like where name not like '%o%';
+---------+-------+
| test_id | name |
+---------+-------+
| 4 | three |
+---------+-------+
1 row in set (0.00 sec)
=20
=20
________________________________
=20
ICT Helpdesk: 8939 7116
=20
________________________________
=20
ICT Helpdesk: 8939 7116
=20

------_=_NextPart_001_01C339F8.A7D8D7F6--

Re: NOT LIKE error

am 24.06.2003 09:26:42 von Alexander Keremidarski

Rohan,

Please don't ask such type of questions here. This list is dedicated to Bug
reports with repeatable test cases.

Rohan Hawthorne wrote:


> The 'problem' is that it doesn't return the NULL row with the NOT LIKE
> statement.

This is how NULL is defined in theory and standard.
NULL has meaning of "unknown" therefore it can't be compared with =, !=, <, >,
LIKE because result is always unknown.



Best regards

--
Are you MySQL certified? -> http://www.mysql.com/certification
For technical support contracts, visit https://order.mysql.com/?ref=msal
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Alexander Keremidarski
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Sofia, Bulgaria
<___/ www.mysql.com




--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org