We can attach certain keywords to the select statement to output different types of results.
For example we can use the distinct keyword to output only unique values from specified columns in a
table the distinct keyword eliminates any duplicate records that would normally have been output with
a basic SELECT statement to use the distinct keyword just replace your existing s Kubo statement with
this line
so here.
This is the distinct keyword in our select statement and we've only specified that we want it where
the first name column if you wanted to attach multiple columns you can do so by adding a comma and then
the second column but in this case we'll just do one column and then we also have to specify what.
Table we want to query.
In this case its users.
Now the next thing we need to edit here is in our echo statement we're outputting all the values in
each column.
This time we only want to output the first name.
So you're going to have to replace the echo statement with this echo statement.
So this time we're just putting the name
because that's all we're looking for.
Firstly so now we pressed the refresh button you'll notice that all the first names have been output.
This is because we did not have any values that were duplicate what if we did you'd notice that they
wouldn't be in this list.