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 .. 96 97 98 99 100 101 < 102 > 103 104 105 106 107 108 .. 241 >> Next


Any non-Latin single byte character, any multibyte character, and any byte indicating a transition between single byte characters and multibyte characters is excluded from this function.

If the character strings to be sorted have the CASESPECIFIC attribute, conversion to uppercase is not performed. (CASESPECIFIC is the default in ANSI mode). In this condition, simple Latin letters are considered matched only if they are the same letters and the same case.

MULTINATIONAL collation is enabled at the user level via the COLLATION option of the CREATE USER or MODIFY USER statement. If a collation is not specified, the default is HOST; that is, the standard sort ordering of the client system (EBCDIC for IBM clients, ASCII for all others).

You can override the default at the session level by issuing the SET SESSION COLLATION statement.

When MULTINATIONAL collation is in effect, the default collation sequence is determined by the collation setting installed at system start-up. See also Appendix G, “International and Japanese Character Support”.

Each international sort sequence is defined by program constants and no check is made to ensure that collation is compatible with the character set of the current session. The choice of sequence is controlled by your database administrator. The programmed character sequences cannot be changed.

7-36

Teradata RDBMS for UNIX SQL Reference
Queries: The SELECT Statement

ORDER BY Clause

European Sort Order

Table 7-1

European Sort Order

The sort order uses a two-level comparison that involves the following rules:

• For Teradata mode, all lowercase letters are first mapped to their uppercase equivalents unless CASESPECIFIC is specified in the query or was defined for the column being accessed.

In ANSI mode, the default is casespecific and the user must use NOT CASESPECIFIC to change this.

• All diacritical forms of the same letter are given the value of the base letter; that is, A is given the value of A, O is given the value of O, and so forth.

• If two strings produce the same value, the characters are further ordered according to their sort position in their diacritical equivalence class (defined in Table 7-1).

• Unless the query specifies the DESC sort option, collation is in ascending order.

When these rules are applied, the words “abbey,” “Active,” and “adage” are returned in this order,

abbey Active adage

and the names Muller, Handl, Bockh, Mueller, Handl, Bohr, Bock, and Muller are ordered as:

Bock Bockh Bohr Handl

Handl Mueller Muller Muller

Equivalence classes and the ordering of diacritical characters in each class are shown in Table 7-1.

The classes listed here are for characters that have diacritical forms.

a A
a A
a A
a A
a A
a A

C

Q

e E
e E
¸ E
e E
¸ E

n

n

N

N

î O
î Î
î Î
î Î
î Î
î Î
î O

S

U

AE

O slash

A ring

s S {{ss}}

u U u U u U u U (U tilde) u U

Ó

Ó

æ

Æ

0 0

A

Y

Teradata RDBMS for UNIX SQL Reference

7-37
Queries: The SELECT Statement

ORDER BY Clause

To ensure that sorting of character data is identical with that of the Japanese Character Sort client, users at a Japanese character site should set their collation as

Order Considerations 7 follows:

• KanjiEUC or KanjiShift-JIS character set users should use the ASCII collation.

• Users under the KATAKANAEBCDIC, KANJIEBCDIC5026_0I, or KANJIEBCDIC5035_0I character set, should install either KATAKANAEBCDIC, KANJIEBCDIC5026_0I, or KANJIEBCDIC5035_0I, respectively, at start-up time, and use MULTINATIONAL collation..

These sort orders use a one-level binary ordering.

Character data collation is handled as follows:

• Unless the CASESPECIFIC qualifier is specified in the query or was defined for the column being accessed, any simple Latin Letters are converted to their uppercase equivalents.

• Characters identified as single byte characters under the current character set are converted according to the collation sequence in effect for the session.

Note that under the KanjiEUC character set, the ss3 0x8F is converted to 0xFF. This means that a user-defined KanjiEUC codeset 3 are not ordered properly with respect to other KanjiEUC code sets. The order of other KanjiEUC codesets is proper (that is, ordering is the same as the binary ordering on the client system).

• Characters identified as multibyte characters remain in the client encoding and are collated based on their binary values.

• Graphic data string collation is based on logical characters in the binary value on the client system.

The following examples illustrate the use of the ORDER BY clause:

Examples

The following example produces a list of employees, sorted by years Example I of work experience.

SELECT Name, JobTitle, YrsExp FROM Employee ORDER BY YrsExp;

7-38

Teradata RDBMS for UNIX SQL Reference
Queries: The SELECT Statement

ORDER BY Clause
Previous << 1 .. 96 97 98 99 100 101 < 102 > 103 104 105 106 107 108 .. 241 >> Next