how to select distinct from table using sql command