Question : SQL query help (MySQL)

I have the following table;

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
field1 field2
aaa 9999
aaa 1111
aaa 2222
aaa 5555
ffff 3333
ffff 9999
hhhh 1111
hhhh 0000
vvvv 2222
vvvv 8888


I need to return all field2 values = 1111 and those that share the same field1 value, i.e.
1:
2:
3:
4:
5:
6:
7:
field1 field2
aaa 9999
aaa 1111
aaa 2222
aaa 5555
hhhh 1111
hhhh 0000


I am using MySQL and it looks like I can't use 'IN' as it is disabled.

Answer : SQL query help (MySQL)

select b.field1, b.field2
from tbl a inner join tbl b on a.field1=b.field1
where a.field2=1111
Random Solutions  
 
programming4us programming4us