69 lines
4.0 KiB
HTML
69 lines
4.0 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="copyright" content="(C) Copyright IBM Corporation 2005" />
|
|
<meta name="DC.rights.owner" content="(C) Copyright IBM Corporation 2005" />
|
|
<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="task" />
|
|
<meta name="DC.Title" content="Create a WHERE clause" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzatcview.htm" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="rzatcwhere" />
|
|
<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>Create a WHERE clause</title>
|
|
</head>
|
|
<body id="rzatcwhere"><a name="rzatcwhere"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Create a WHERE clause</h1>
|
|
<div><div class="section">The view is now essentially finished, but for this example, you only
|
|
want to view those items that have been ordered in the last 14 days. To specify
|
|
this information, you need to create a WHERE clause:</div>
|
|
<ol><li class="stepexpand"><span>Click <span class="uicontrol">Select Rows</span>.</span></li>
|
|
<li class="stepexpand"><span>On the Select Rows window, enter the following command: <kbd class="userinput">WHERE
|
|
LAST_ORDER_DATE > CURRENT DATE - 14 DAYS</kbd>. You can select the elements
|
|
that make up this WHERE clause by selecting them from the options shown, or
|
|
you can enter them in the <span class="uicontrol">Clause</span> field.</span></li>
|
|
<li class="stepexpand"><span>Click <span class="uicontrol">OK</span>.</span></li>
|
|
<li class="stepexpand"><span>To view the SQL used to generate this view, click <strong>Show SQL</strong>.</span></li>
|
|
<li class="stepexpand"><span>Click <span class="uicontrol">OK</span> to create the view.</span> <p><br /><img src="rzatc006.gif" alt="screen capture of select rows window" /><br /></p>
|
|
</li>
|
|
<li class="stepexpand"><span>To display the contents of RECENT_ORDERS, right-click RECENT_ORDERS
|
|
and select <span class="uicontrol">View Contents</span>. </span></li>
|
|
</ol>
|
|
<div class="section">You should see the following information displayed:
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" width="100%" frame="border" border="1" rules="all"><thead align="left"><tr><th valign="top" width="27.2108843537415%" id="d0e61">ITEM_NUMBER </th>
|
|
<th valign="top" width="36.054421768707485%" id="d0e63">LAST_ORDER_DATE </th>
|
|
<th valign="top" width="36.734693877551024%" id="d0e65">QUANTITY_ON_HAND</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr><td valign="top" width="27.2108843537415%" headers="d0e61 ">303476 </td>
|
|
<td valign="top" width="36.054421768707485%" headers="d0e63 ">2003-09-22</td>
|
|
<td valign="top" width="36.734693877551024%" headers="d0e65 ">100</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<p>In the preceding example, the columns in the view
|
|
have the same name as the columns in the table because you did not specify
|
|
new names. The schema that the view is created into does not need to be the
|
|
same schema as the table it is built over. You can use any schema.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzatcview.htm">Create and use a view</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |