I have a table with two columns;
CREATE TABLE IF NOT EXISTS `QUESTION_CATEGORY_RELATION` (
`question_id` int(16) NOT NULL,
`category_id` int(16) NOT NULL,
KEY `category_id` (`category_id`),
KEY `question_id` (`question_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `QUESTION_CATEGORY_RELATION` (`question_id`, `category_id`) VALUES
(1, 2),
(1, 3),
(2, 1),
(2, 2);
I want to create a query that will search for a question_id with content_id 2 and content_id 3
e.g.:
SELECT *
FROM `QUESTION_CONTENTS_REL`
WHERE `content_id` = 2 AND `content_id` = 3