The Distinct keyword tells MySQL to return only distinct values
>>SELECT DISTINCT name From user;
DESCRIPTION
Tell MySQL to return only the unique values from the query. The Distinct keyword must place before a column name. The Distinct keyword will apply to all the columns. * Note: First query will return all the rows, and we can see that the user name Mirza is displayed twice. In the second query, we can see that the user Mirza is displayed only once.
0 comments:
Post a Comment