EDIT:That was fast. The reason why I have this is because the table is a pivot table between 2 tables one has “id” as primary key and the other “type” primary key
Hello.
I want the following:
Find only find “id” where “type” is 1 AND 2 AND 3
This is not working:
SELECT * FROM `table` WHERE `type` = 1 AND `type` = 2 AND `type` = 3;
The SELECT statment should only return one row (id = 1)
Table
id type
1 1
1 2
1 3
2 1
2 2
3 3
If you only want to know the Id then add the keyword Distinct and just select the id,
where there are records for the three different types …
If you want to see the Id and the type then add the type to the select,
if you want to see every row that has that id, then leave out the distinct