<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Create the table using an identity column or have the column take a column default which is the next value from a sequence.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Martin Bowes<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Allan Biggs [mailto:Allan.Biggs@GBR.dupont.com]
<br>
<b>Sent:</b> 06 February 2017 15:42<br>
<b>To:</b> info-ingres@lists.planetingres.org; openroad-users@googlegroups.com<br>
<b>Subject:</b> [Info-ingres] One up unique number for an attribute - in SQL - does anyone know the trick of doing this?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif"">in command line sql I am populating a new table - one of the columns is a sort order
</span><br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">each row of this field <b><u>must</u></b> be a 'one up' unique number starting at 1 and ending as the number of rows in the table </span>
<br>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">I know that I could do this in OpenROAD , and in another guise this is done in OpenROAD, but in this case it has to be done in SQL or maybe in report writer.</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">It does not matter which rows contain 1 ,2 etc although one of the columns does have a set of unique numbers with gaps which could be used to determine the order of row 1, 2 etc. </span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Does anyone know of a 'trick' to do this?</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">In mysql it is possible to define unique one up numbers when creating a table does modern Ingres have this feature?</span>
<br>
<br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">thanks </span><br>
<span style="font-size:10.0pt;font-family:"Arial","sans-serif"">Allan </span><o:p></o:p></p>
<p><br>
This communication is for use by the intended recipient and contains<br>
information that may be Privileged, confidential or copyrighted under<br>
applicable law. If you are not the intended recipient, you are hereby<br>
formally notified that any use, copying or distribution of this e-mail,<br>
in whole or in part, is strictly prohibited. Please notify the sender by<br>
return e-mail and delete this e-mail from your system. Unless explicitly<br>
and conspicuously designated as "E-Contract Intended", this e-mail does<br>
not constitute a contract offer, a contract amendment, or an acceptance<br>
of a contract offer. This e-mail does not constitute a consent to the<br>
use of sender's contact information for direct marketing purposes or for<br>
transfers of data to third parties.<o:p></o:p></p>
<p>Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean<o:p></o:p></p>
<p> <a href="http://www.DuPont.com/corp/email_disclaimer.html">http://www.DuPont.com/corp/email_disclaimer.html</a><o:p></o:p></p>
</div>
</body>
</html>