select A.a,b,c,d from A,B where A.a=B.a and f='1'