Filter for displaying records from the database

Hello, such a question arose, let’s say I have a table id and name, there are 3 fields with the names Vasya, Petya, Vasya, and here’s how to make a request so that it does not repeat the same names, that is, to display Vasya Petya and all.


Answer 1, authority 100%

select distinct name from table

If you need an id, then you need to clarify which washi to get it from. If the first one, then like this:

select min(id), name from table group by name

Answer 2, authority 33%

SELECT * FROM 'table' GROUP BY 'column'

column – a column in which repetitions should NOT be displayed.