Finding the exclusive records in a table
Finding the exclusive records in a table
Student
Skilled in SEO, content writing, and digital marketing. Completed several years of working in many organizations including multinational companies. I love to learn new things in life that keep me motivated.
Sure, you can find the exclusive records in a table using the
DISTINCTkeyword and theWHEREclause. The syntax is as follows:SQL
For example, the following SQL statement will find all exclusive records in the
productstable where thepricecolumn is greater than 100:SQL
This will return a list of all unique prices in the
productstable where the price is greater than 100.Here is an example of how to find the exclusive records in a table in MySQL:
SQL
This will return the following result:
As you can see, the
DISTINCTkeyword has returned all unique prices in theproductstable where the price is greater than 100.Here are some additional things to keep in mind when using the
DISTINCTkeyword:DISTINCTkeyword can be used with any column.DISTINCTkeyword will only return unique values.WHEREclause to filter the results of theDISTINCTkeyword.