Join Bill Weinman for an in-depth discussion in this video Searching within a result set, part of MySQL Essential Training.
…In this lesson, I'll show you a practical example of using a sub…select to provide a list of rows to search for in a table.…We're going to be using the album database for this lesson.…I'm going to start with a simple query.…It'll give us a list of albums that have…tracks with a duration of 90 seconds or less.…And so for this, I'm going to select from the track table, and I'm going to select…distinct album IDs where the duration of a track is less than or equal to 90 seconds.…
So it looks like this, SELECT DISTINCT album_id FROM…track WHERE duration is less than or equal to 90 seconds.…And when I say Go, I get a list of two album_ids.…And these are the albums that have tracks with…durations of less than or equal to 90 seconds.…Now, I can get all of the details on the albums by using this query.…As just the list of album IDs for a where clause in a query on the album table.…
So, that looks like this.…So, now I'm selecting from the album table, and I'm using the result of this…other query to provide the IDs for the rows that I want to see.…
- Writing queries
- Creating and updating databases and tables
- Using MySQL built-in functions
- Sorting and filtering data
- Updating tables with triggers
- Working with subselects and views
- Creating and using a stored function
Skill Level Beginner
1. Installing and Configuring the Test Environment
2. Basic Syntax
3. Creating a Database
4. MySQL Data Types
5. MySQL Functions
8. Subselects and Views
9. Stored Routines
10. PHP's PDO Interface with MySQL
- 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.