157 lines
11 KiB
HTML
157 lines
11 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Sort sequence used with ORDER BY and row selection" />
|
||
|
<meta name="abstract" content="To see how to use a sort sequence, run the examples against the STAFF table shown in this topic." />
|
||
|
<meta name="description" content="To see how to use a sort sequence, run the examples against the STAFF table shown in this topic." />
|
||
|
<meta name="DC.subject" content="sort sequence, used with ORDER BY, used with row selection, ORDER BY, sort sequence, using, row, selection using sort sequence, precompiler command, CRTSQLxxx" />
|
||
|
<meta name="keywords" content="sort sequence, used with ORDER BY, used with row selection, ORDER BY, sort sequence, using, row, selection using sort sequence, precompiler command, CRTSQLxxx" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafyussisql.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafyorderby2.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rbafyrecordselect.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rbafyssorder" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Sort sequence used with ORDER BY and row selection</title>
|
||
|
</head>
|
||
|
<body id="rbafyssorder"><a name="rbafyssorder"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Sort sequence used with ORDER BY and row selection</h1>
|
||
|
<div><p>To see how to use a sort sequence, run the examples against the
|
||
|
STAFF table shown in this topic.</p>
|
||
|
<div class="section"><p>Notice that the values in the JOB column are in mixed case. You
|
||
|
can see the values 'Mgr', 'MGR', and 'mgr'.</p>
|
||
|
</div>
|
||
|
|
||
|
<div class="tablenoborder"><a name="rbafyssorder__nlsstb"><!-- --></a><table cellpadding="4" cellspacing="0" summary="" id="rbafyssorder__nlsstb" width="100%" frame="hsides" border="1" rules="all"><caption>Table 1. The STAFF table</caption><thead align="left"><tr><th align="left" valign="bottom" width="14.25925925925926%" id="d0e47">ID</th>
|
||
|
<th align="left" valign="bottom" width="14.25925925925926%" id="d0e49">NAME</th>
|
||
|
<th align="left" valign="bottom" width="14.25925925925926%" id="d0e51">DEPT</th>
|
||
|
<th align="left" valign="bottom" width="14.25925925925926%" id="d0e53">JOB</th>
|
||
|
<th align="left" valign="bottom" width="14.25925925925926%" id="d0e55">YEARS</th>
|
||
|
<th align="left" valign="bottom" width="14.25925925925926%" id="d0e57">SALARY</th>
|
||
|
<th align="left" valign="bottom" width="14.444444444444443%" id="d0e59">COMM</th>
|
||
|
</tr>
|
||
|
</thead>
|
||
|
<tbody><tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">10</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Sanders</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">20</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">Mgr</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">7</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">18357.50</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">0</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">20</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Pernal</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">20</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">Sales</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">8</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">18171.25</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">612.45</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">30</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Merenghi</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">38</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">MGR</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">5</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">17506.75</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">0</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">40</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">OBrien</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">38</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">Sales</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">6</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">18006.00</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">846.55</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">50</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Hanes</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">15</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">Mgr</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">10</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">20659.80</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">0</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">60</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Quigley</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">38</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">SALES</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">0</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">16808.30</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">650.25</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">70</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Rothman</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">15</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">Sales</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">7</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">16502.83</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">1152.00</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">80</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">James</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">20</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">Clerk</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">0</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">13504.60</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">128.20</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">90</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Koonitz</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">42</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">sales</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">6</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">18001.75</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">1386.70</td>
|
||
|
</tr>
|
||
|
<tr><td align="left" valign="top" width="14.25925925925926%" headers="d0e47 ">100</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e49 ">Plotz</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e51 ">42</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e53 ">mgr</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e55 ">6</td>
|
||
|
<td align="left" valign="top" width="14.25925925925926%" headers="d0e57 ">18352.80</td>
|
||
|
<td align="left" valign="top" width="14.444444444444443%" headers="d0e59 ">0</td>
|
||
|
</tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
<div class="section"><p>In the following examples, the results are shown for each statement
|
||
|
using:</p>
|
||
|
<ul><li>*HEX sort sequence</li>
|
||
|
<li>Shared-weight sort sequence using the language identifier ENU</li>
|
||
|
<li>Unique-weight sort sequence using the language identifier ENU</li>
|
||
|
</ul>
|
||
|
<div class="note"><span class="notetitle">Note:</span> ENU is chosen as a language identifier by specifying either SRTSEQ(*LANGIDUNQ),
|
||
|
or SRTSEQ(*LANGIDSHR) and LANGID(ENU), on the CRTSQLxxx, STRSQL, or RUNSQLSTM
|
||
|
commands, or by using the SET OPTION statement.</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<ul class="ullinks">
|
||
|
<li class="ulchildlink"><strong><a href="rbafyorderby2.htm">Sort sequence and ORDER BY</a></strong><br />
|
||
|
See how sort sequences work with ORDER BY.</li>
|
||
|
<li class="ulchildlink"><strong><a href="rbafyrecordselect.htm">Row selection</a></strong><br />
|
||
|
See how sort sequences work with row selection.</li>
|
||
|
</ul>
|
||
|
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rbafyussisql.htm" title="A sort sequence defines how characters in a character set relate to each other when they are compared or ordered. Normalization allows you to compare strings that contain combining characters.">Sort sequences and normalization in SQL</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|