表A(主表)、B(从表)关联字段fid表B
id fid  fid
---------------------
1   1    2
2   2    1
3   1    1表A
id  name
---------------------
1    tom
2    jon查询出结果
B.id   A.name  A.name
---------------------
1      tom      jon
2      jon      tom
3      tom      tom