Advanced Select Techniques
It’s easy to return data from a table. What’s not so easy is to get the data you need how you need it, utilizing fast, set-based methods. This chapter will show you some of the advanced techniques that can be used when selecting data.
6-1. Avoiding Duplicate Results
You need to see all of the dates where any employee was hired. However, you have hired multiple employees on the same dates, and you want to see the date only once.
Utilize the DISTINCT clause of the SELECT statement to remove duplicate values.
SELECT DISTINCT HireDateFROM HumanResources.EmployeeORDER BY ...