You may return only unique rows from your query, removing all duplicates, using the SELECT DISTINCT statement.
- [Instructor] There are times when you may want to know … all the different values of a column in your result … without duplication. … For this purpose, SQL provides … the SELECT DISTINCT statement. … Here again, we're going to use the world database … and I'm going to type a quick query, here. … SELECT Continent FROM Country; … and when I execute this query, you notice we get … all 239 rows and every continent. … And you'll notice there's a lot of duplication, here. … A lot of Asia, there's some North America, Europe, Africa, … Africa, Africa. … So, if we just want a list of all the different continents, … we can use SELECT DISTINCT, instead. … And now when I execute the query, you notice we get … just seven results: … Asia, Europe, North America, … Africa, Oceania, … South America, and Antarctica. … So using SELECT DISTINCT, you get only unique results. … For a more thorough example of this, … let's switch to the Test database … and I'm going to copy in some SQL from the chapter three …
This course was created by Bill Weinman. We are pleased to offer this training in our library.
- How databases are organized
- Selecting rows and columns
- Creating new tables
- Inserting and updating data
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Using CRUD functions
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times2m 6s
11. Views and Subselects
12. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.