I have an sql table like this:
TABLE: Info
ID | JOB | Value
--------|----------|------------------
1 | leader | 3
2 | Host | 212
1 | User | 4
2 | leader | 5
2 | Host | 4
I'm trying to get the rows where a duplicate ID must contain 3 and 4 from the Value column. I'm currently using this query:
select * from info where value = 3 and 4
group by id having count(*) > 1;
my result using this query
ID | JOB | Value
--------|----------|------------------
null | null | null
whereas my expected result should be:
ID | JOB | Value
--------|----------|------------------
1 | leader | 3
1 | User | 4
Please help as I'm not sure what I'm doing wrong