select tableB.field4 from tableA,tableB
where tableA.field2 = tableB.field3
and tableA.field1 = 12;