O'Reilly logo

Sams Teach Yourself Microsoft® SQL Server T-SQL in 10 Minutes, Second Edition by Ben Forta

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

Lesson 15. Creating Advanced Joins

In this lesson, you learn all about additional join types—what they are and how to use them. You also learn how to use table aliases and how to use aggregate functions with joined tables.

Using Table Aliases

Back in Lesson 9, “Creating Calculated Fields,” you learned how to use aliases to refer to retrieved table columns. The syntax to alias a column looks like this:

Input Image

SELECT RTrim(vend_name) + ' (' + RTrim(vend_country) + ')'        AS vend_title FROM vendors ORDER BY vend_name;

In addition to using aliases for column names and calculated fields, SQL also enables you to ...

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