select a.XXX, b.XXX, c.XXX from tb1 as a inner join tb2 as b on a.fid=b.freplyid inner join tb3 as c on a.fimgid=c.fcontentid;