Using the table alias

By default, whatever column you have given in the SELECT clause will appear in the results. In the previous examples, you have found out the count, but it is displayed as COUNT(*). You can change it by using the AS alias:

mysql> SELECT COUNT(*) AS count FROM employees WHERE hire_date BETWEEN '1986-12-01' AND '1986-12-31';+-------+| count |+-------+|  3081 |+-------+1 row in set (0.06 sec)

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.