Learn How to Create a Simple Subselect in MySQL


show more Creating a simple subselect provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training show less
please wait ...

Creating a simple subselect

A subselect is effectively a nested select statement. In SQL, the result of a select statement is effectively a table. It usually just exists in memory but it can always be used, as you would use a table. Because of this, a select statement may be used as a data source for another select statement. This usage is called a subselect or sometimes a subquery. For this lesson we'll be using the World Database. And I'm going to copy and paste some code from the chapter eight exercise file. And I'm just going to grab this much of it, down to this first select statement there.

Copy and paste it into the SID. Go ahead and press go. See, I create a temporary table called T. It just has two columns, A and B. And there are just six character strings. And I've inserted three rows. In column A we have state codes, followed by numbers. And in column B we have country codes, followed by numbers. And I have this select statement using substrings to break apart these pact fields so effectively in column A w...

Creating a simple subselect
Video duration: 3m 23s 4h 24m Beginner

Viewers:

Creating a simple subselect provides you with in-depth training on Developer. Taught by Bill Weinman as part of the MySQL Essential Training

Subject:
Developer
Software:
MySQL
Author:
please wait ...