use innerJoin instead FROM a,b WHERE a.id = b.id