I have created this table:
CREATE TABLE IF NOT EXISTS `names` (
`ID` int(6) unsigned NOT NULL,
`C1` varchar(200),
`C2` varchar(200),
`C3` varchar(200),
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8;
INSERT INTO `names` (`ID`, `C1`, `C2`, `C3`) VALUES
('1', 'Richard', 'Ken', 'Dan'),
('2', NULL,'Richard', 'Helen'),
('3', 'Ken', NULL, 'Maria');
I can select rows that contain "Ken" with an OR:
SELECT *
FROM `names`
WHERE C1 = 'Ken' or C2 = 'Ken' or C3 = 'Ken'
But, I need a better method to select the rows which have “Ken” in one of the columns C1, C2, or C3, which is without using OR.