Books
in black and white
Main menu
Share a book About us Home
Books
Biology Business Chemistry Computers Culture Economics Fiction Games Guide History Management Mathematical Medicine Mental Fitnes Physics Psychology Scince Sport Technics
Ads

Teradata RDBMS forUNIX SQL Reference - NCR

NCR Teradata RDBMS forUNIX SQL Reference - NCR, 1997. - 913 p.
Download (direct link): teradataforunix1997.pdf
Previous << 1 .. 14 15 16 17 18 19 < 20 > 21 22 23 24 25 26 .. 241 >> Next


If you are using SQL in other application programs, refer to that application’s reference manual for instructions on setting or changing the transaction mode.

Users can set the default collation sequence to any of a number of sequences. The available collation sequences are:

• ASCII

• EBCDIC

• MULTINATIONAL

• HOST

Collation can be defined in several different ways:

• As an attribute of the user via the COLLATION option of the

CREATE USER or MODIFY USER statement. • With the SET SESSION COLLATION data definition statement.during a session The ASCII and EBCDIC options are always available.
Collation sequence Description
ASCII Always available.
EBCDIC Always available.
MULTINATIONAL Can be the standard multinational collation, the supplied Norwegian collation, the supplied Swedish collation, or a user-defined multinational collation sequence. Refer to Chapter 7, “Queries: The SELECT Statement,” in the section “ORDER BY Clause” and Appendix G, “International and Japanese Character Support” for information on setting up the MULTINATIONAL collation sequence.
HOST The default. Uses standard collation of the logon client

2-30

Teradata RDBMS for UNIX SQL Reference
Data Handling Fundamentals

Session Parameters

If at least one user-defined character set is established as current, Character Set 2 then the following things are true:

• A batch job or interactive user logged on through BTEQ can request a character set via the BTEQ [.] SET SESSION CHARSET ‘name’ command.

• A CLIv2 (Call-Level Interface Version 2) application can request a character set via the CHARSET name call.

where the ‘name’ or name value, if other than ASCII or EBCDIC, must be a name assigned to the translation codes that define an available character set.

If not explicitly requested, the session default is the character set associated with the logon client. This is either the standard client default, or the character set assigned to the client by the database administrator.

The HELP SESSION statement identifies the transaction mode, HELP SESSION 2 character set, and collation sequence in effect for the current session.

refer to Chapter 8, “Teradata SQL Syntax Guide,” in the section “HELP SESSION” for details on using HELP SESSION.

Express Logon improves the logon response time and is especially ExPress Logon useful in the OLTP environment where sessions are short-lived.

Enable or disable this mode from the Gateway Global Utility, from the XGTWGLOBAL interface:

In this mode . . . Use this command to enable or disable Express Logon . . .
Terminal ENABLE EXLOGON
DISABLE EXLOGON
Window EXLOGON button
(via the LOGON dialog box)

The feature can be enabled or disabled for a particular host group, or for all host groups. For more detail on this feature, refer to the Teradata RDBMS for UNIX Utilities Reference.

Teradata RDBMS for UNIX SQL Reference

2-31
Data Handling Fundamentals

Session Parameters

2-32

Teradata RDBMS for UNIX SQL Reference
Joins: Working with Multiple Tables

Chapter 3

Joins: Working with Multiple Tables

Teradata RDBMS fdor UNIX SQL Reference
Joins: Working with Multiple Tables

Teradata RDBMS for UNIX SQL Reference
Joins: Working with Multiple Tables About This Chapter

About This Chapter

This chapter describes the four kinds of joins and how to use them:

• Inner

• Outer

• Cross

• Self

Unless otherwise specified, joins, by default, are inner joins.

The different types of outer joins are:

• Left

• Right

• Full

Joins between tables and views are also discussed, as well as joins on views with aggregates.

Teradata RDBMS for UNIX SQL Reference

3-1
Joins: Working with Multiple Tables

Inner Join

Introduction

Example

Inner Join

A join allows you to select columns and rows from two or more tables and views. Up to 16 tables and views may be joined. An inner join selects data from two or more tables or views. Each source must be named and the join condition, the common relationship between the tables or views to be joined, specified in a WHERE clause.

For example, the department location of employee Marston may be determined by joining the Employee and Department tables on the column on which the join is defined the column that has values common to both (DeptNo).

SELECT Loc FROM Department, Employee WHERE Employee.Name = 'Marston A'

AND Employee.DeptNo = Department.DeptNo;

In effect, this query asks two questions:

• What is the number of Marston’s department in Employee?

• What is the location code for that department in Department?

The key to answering both questions is the DeptNo column, which has the same values in both tables, and thus can be used to form the join relationship (the actual name of the column is irrelevant).

The result of this inner join is:

Loc

ATL

3-2

Teradata RDBMS for UNIX SQL Reference
Joins: Working with Multiple Tables
Previous << 1 .. 14 15 16 17 18 19 < 20 > 21 22 23 24 25 26 .. 241 >> Next