I am reading a book about database design and they ask to show the result of a project operation that lists the CustCity and CustState from the Customer table. Well my Customer table has some duplicates in those rows with four from WA and two from CO but two entries are the exact same from Seattle, WA as well.
My question is how does the project operator work exactly? The book has a snippet that says it eliminates duplicate rows if necessary but if it works similar to the statement below then it wouldn’t remove any duplicates.
SELECT CustCity, CustState FROM Customer;
Any clarification would be appreciated.
You need to explicitly tell the database to remove duplicates from the result set, using
DISTINCT: