MySQL Distinct ClauseMySQL DISTINCT clause is used to remove duplicate records from the table and fetch only the unique records. The DISTINCT clause is only used with the SELECT statement. Syntax: Parametersexpressions: specify the columns or calculations that you want to retrieve. tables: specify the name of the tables from where you retrieve records. There must be at least one table listed in the FROM clause. WHERE conditions: It is optional. It specifies the conditions that must be met for the records to be selected. Note:
MySQL DISTINCT Clause with single expressionIf you use a single expression then the MySQL DISTINCT clause will return a single field with unique records (no duplicate record). See the table: Use the following query: MySQL DISTINCT Clause with multiple expressionsIf you use multiple expressions with DISTINCT Clause then MySQL DISTINCT clause will remove duplicates from more than one field in your SELECT statement. Use the following query: Next TopicMySQL FROM Clause |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India