How can I get project_id, which has technology_id = 1 and technology_id = 2 in one row?
+------------+---------------+
| project_id | technology_id |
+------------+---------------+
| 1 | 1 |
| 1 | 2 |
| 3 | 2 |
| 7 | 1 |
| 9 | 1 |
+------------+---------------+
Group by the product_id
and take only those groups having both technology_id
s
select project_id
from your_table
where technology_id in (1,2)
group by project_id
having count(*) = 2