TL / DR: I run this query = "Select * from test where id = 0"and return all rows.
Here is my code below:
CREATE TABLE IF NOT EXISTS `test` (
`id` varchar(20) NOT NULL,
`desc` varchar(100) NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `test` (`id`, `desc`) VALUES
('AA', 'AA Desc'),
('BB', 'BB Desc');
SELECT count(*) FROM test WHERE id = 0
In my opinion, it should not return rows, but it returns all rows in the table. Am I missing something? Any help and explanation would be most welcome.
source
share