how can i make an sql statement with a distinct?