I'm querying an INT column with a string, like this:
SELECT id
FROM (`navigation_links`)
WHERE `navigation_links`.`navigation_link_id` = 'anyRandomString'
(originally, this was by accident)
- Expected results:
0, becausenavigation_link_idis anINT - Actual results: It seems to return every row whose value is
0
This returns the exact inverse:
SELECT id
FROM (`navigation_links`)
WHERE `navigation_links`.`navigation_link_id` != 'anyRandomString'
Here is the table, stripped down:
CREATE TABLE `navigation_links` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`navigation_link_id` INT(10) UNSIGNED NULL DEFAULT '0',
`navigation_group_id` INT(10) UNSIGNED NULL DEFAULT '0',
PRIMARY KEY (`id`)
)
Any idea what this is all about?