Fitting margin with SQL.