O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Selecting columns

Suppose you need emp_no and dept_no from dept_manager:

mysql> SELECT emp_no, dept_no FROM dept_manager;+--------+---------+| emp_no | dept_no |+--------+---------+| 110022 | d001    || 110039 | d001    || 110085 | d002    || 110114 | d002    || 110183 | d003    || 110228 | d003    || 110303 | d004    || 110344 | d004    || 110386 | d004    || 110420 | d004    || 110511 | d005    || 110567 | d005    || 110725 | d006    || 110765 | d006    || 110800 | d006    || 110854 | d006    || 111035 | d007    || 111133 | d007    || 111400 | d008    || 111534 | d008    || 111692 | d009    || 111784 | d009    || 111877 | d009    || 111939 | d009    |+--------+---------+24 rows in set (0.00 sec)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required