From the course: SQL: Data Reporting and Analysis

Unlock the full course today

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

Change report headings with an alias

Change report headings with an alias - SQL Tutorial

From the course: SQL: Data Reporting and Analysis

Change report headings with an alias

- [Instructor] Let's revisit a query from a previous section because we're going to update it and make it easier to read. So we've got select full name basically, and then length of full name and order alphabetically, descending. So if we look down here, we've got Zero Cage, with nine characters, and that's at the top, because alphabetically, it comes last. Remember that length would be len in Microsoft, and that concat in Oracle would only accept two parameters. You'd have to use the shorthand, which is the double pipe, for Oracle. Now this query looks a bit long, and worst of all, bearing in mind, that this table down here is our results, and therefore our report, these column headings are awful. They're unreadable, really, to most people. You'd be pleased to know though, that there's a way of making this better, and it makes our query shorter and more efficient, and it's called an alias. So we can say, select concat first…

Contents