0% found this document useful (0 votes)
70 views2 pages

Teradata SQL Quick Reference Guide: Simplicity by Design, Second Edition

This document is an excerpt from the Teradata SQL Quick Reference Guide: Simplicity by Design, Second Edition. This particular section discusses techniques for specifically referencing table and columns across databases using qualifying names with up to three levels (database, table, column). It also introduces temporarily renaming tables with alias names. Examples are provided to demonstrate 2-level and 3-level qualifying of column names and tables.

Uploaded by

dharmendard
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views2 pages

Teradata SQL Quick Reference Guide: Simplicity by Design, Second Edition

This document is an excerpt from the Teradata SQL Quick Reference Guide: Simplicity by Design, Second Edition. This particular section discusses techniques for specifically referencing table and columns across databases using qualifying names with up to three levels (database, table, column). It also introduces temporarily renaming tables with alias names. Examples are provided to demonstrate 2-level and 3-level qualifying of column names and tables.

Uploaded by

dharmendard
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Teradata SQL Quick Reference Guide: Simplicity by Design, Second

Edition
by Tom Coffing, Michael Larkins and Steve Wilmes
Coffing Data Warehousing. (c) 2006. Copying Prohibited.

Reprinted for Anil Kumar Gupta, IBM


[email protected]
Reprinted with permission as a subscription benefit of Books24x7,
http://www.books24x7.com/

All rights reserved. Reproduction and/or distribution in whole or in part in electronic,paper or


other forms without written permission is prohibited.

TeradataSQLQuickReferenceGuide:SimplicitybyDesign,SecondEdition

Appendix E: Qualifying and Table Aliasing


This section provides techniques to specifically reference table and columns throughout all databases and to temporarily rename tables with
an alias name.

Qualifying Column Names


3-level reference: <database-name>.<table-name>.<column-name>
2-level reference: <database-name>.<table-name>
2-level reference: <table-name>.<column-name>

SELECT SQL_CLASS.Employee_Table.Dept_No
FROM Employee_Table ;

SELECT *
FROM SQL_CLASS.Employee_Table ;

SELECT Student_Table.Student_Id
FROM Student_Table
INNER JOIN Student_Course_Table
ON Student_Table.Student_Id
= Student_Course_Table.Student_Id ;

Page 2 / 2
Reprintedforibm\[email protected],IBM

CoffingDataWarehousing,CoffingPublishing(c)2006,CopyingProhibited

You might also like