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 - 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
-
-
-
-
Retrieve data with SELECT5m 31s
-
(Locked)
Filter results with the WHERE clause5m 4s
-
(Locked)
Use LIKE, IN, and wildcards with WHERE5m 39s
-
(Locked)
Sort SQL results with ORDER BY1m 42s
-
(Locked)
Use string functions on your data6m 41s
-
(Locked)
More advanced string functions8m 35s
-
(Locked)
Change report headings with an alias2m 28s
-
(Locked)
Use date functions with WHERE8m 50s
-
(Locked)
Challenge: Query a table1m 7s
-
(Locked)
Solution: Query a table1m 23s
-
(Locked)
Challenge: Convert case50s
-
(Locked)
Solution: Convert case2m 30s
-
-
-
-
-