From the course: MySQL Essential Training

Unlock this course with a free trial

Join today to access over 23,700 courses taught by industry experts.

Selecting columns

Selecting columns

- [Narrator] Hi, I am Bill Wyman. A given table may have a lot of columns and you'll often be interested in only some of them. Selecting particular columns is easy, and here's how it's done. For this lesson, we'll use the world database here in MySQL Workbench. I'm connected with my admin connection and I'll type use world to select the world database and we'll select all of the rows and columns from the country table and order it by the code column. So I'll say select asterisk from country, order by code. And when I execute that, I get all of the rows and all of the columns from the country table. And it's ordered by the ISO code, which is in this first column, and it's titled code. Now the asterisk here is in the place where you list the columns you want returned in the query. The asterisk is simply a wild card that means all the columns. I'm just going to go ahead and copy and paste this. And in place of the asterisk, I can list particular columns. I could say name, code, region…

Contents