difference in SQLite vs PostGRESQL db call for Distinct