SQL DISTINCT clause
SQL DISTINCT clause Description The SQL DISTINCT clause is used to remove duplicates from the result set of a SELECT statement. Syntax The syntax for the SQL DISTINCT clause is: SELECT DISTINCT expressions FROM tables WHERE conditions; Parameters or Arguments expressions are the columns or calculations that you wish to retrieve. tables are the tables that you wish to retrieve records from. There must be at least one table listed in the FROM clause. conditions are conditions that must be met for the records to be selected. Note When only one expression is provided in the DISTINCT clause, the query will return the unique values for that expression. When more than one expression is provided in the DISTINCT clause, the query will retrieve unique combinations for the expressions listed. In SQL, the DISTINCT clause doesnt ignore NULL values. So when using the DISTINCT clause in your SQL statement, your result set will include NULL as a distinct value. Example - With Single field L...