<font size=1 color=#800080 face="sans-serif">----- Forwarded by Allan
Biggs/GB/CONT/DPT on 06/02/2017 17:03 -----</font>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Allan Biggs/GB/CONT/DPT</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">martin.bowes@ndph.ox.ac.uk</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">06/02/2017 16:51</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [Info-ingres]
One up unique number for an attribute - in SQL - does anyone know the trick
of doing this?</font>
<br>
<hr noshade>
<br>
<br><font size=2 face="sans-serif">Martin,</font>
<br>
<br><font size=2 face="sans-serif">In the example below is there a way
of making &nbsp;it order by test_id [ascending or descending] as you can
see the sorting breaks down at sort_order 4,5,6 and later as well'</font>
<br><font size=2 face="sans-serif">I did try order by in the insert knowing
that is illegal -<b> it is :-)</b> </font>
<br>
<br><font size=2 face="sans-serif">I also tried heapsort instead of btree
on test_id - but that gave a similar result !!</font>
<br>
<br><font size=2 face="sans-serif">Thanks</font>
<br><font size=2 face="sans-serif">Allan </font>
<br>
<br>
<br>
<br>
<br>
<br><font size=4 face="Courier New">drop wrr2tests_w_asd;</font>
<br><font size=4 face="Courier New">Executing . . .</font>
<br>
<br><font size=4 face="Courier New">continue</font>
<br><font size=4 face="Courier New">* * * * * * * * * * * * * * * * * *
* *</font>
<br><font size=4 face="Courier New">create table wrr2tests_w_asd</font>
<br><font size=4 face="Courier New">( page_id &nbsp; &nbsp;integer not
null with default,</font>
<br><font size=4 face="Courier New">&nbsp; test_id &nbsp; &nbsp;integer
not null with default,</font>
<br><font size=4 face="Courier New">&nbsp; sort_order integer generated
always as identity (start with 1 increment by 1)</font>
<br><font size=4 face="Courier New">);</font>
<br><font size=4 face="Courier New">modify wrr2tests_w_asd to btree on
test_id ;</font>
<br>
<br><font size=4 face="Courier New">insert into wrr2tests_w_asd</font>
<br><font size=4 face="Courier New">( page_id &nbsp; &nbsp;,</font>
<br><font size=4 face="Courier New">&nbsp; test_id &nbsp; &nbsp;)</font>
<br><font size=4 face="Courier New">select</font>
<br><font size=4 face="Courier New">page_id &nbsp; &nbsp;,</font>
<br><font size=4 face="Courier New">&nbsp; test_id</font>
<br><font size=4 face="Courier New">from</font>
<br><font size=4 face="Courier New">sspgcerttests_t_asd</font>
<br><font size=4 face="Courier New">;</font>
<br>
<br>
<br><font size=4 face="Courier New">Executing . . .</font>
<br>
<br><font size=4 face="Courier New">(0 rows)</font>
<br><font size=4 face="Courier New">(32 rows)</font>
<br><font size=4 face="Courier New">continue</font>
<br><font size=4 face="Courier New">* * * * *</font>
<br>
<br><font size=4 face="Courier New">select * from wrr2tests_w_asd order
by sort_order ;</font>
<br>
<br><font size=4 face="Courier New">Executing . . .</font>
<br>
<br>
<br><font size=4 face="Courier New">+-------------+-------------+-------------+</font>
<br><font size=4 face="Courier New">|page_id &nbsp; &nbsp; &nbsp;|test_id
&nbsp; &nbsp; &nbsp;|sort_order &nbsp; |</font>
<br><font size=4 face="Courier New">+-------------+-------------+-------------+</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1688| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1687| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1638| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;3|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1637| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;4|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1410| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1405| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;6|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1407| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;7|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1402| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;8|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1409| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;9|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1404| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1399| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 11|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1398| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 12|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1397| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 13|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1396| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 14|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1395| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 15|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1356| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 16|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1355| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 17|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1354| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 18|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1332| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 19|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1394| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 20|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1393| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 21|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1392| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 22|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1391| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 23|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1390| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 24|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1353| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 25|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1352| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 26|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1351| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 27|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1331| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 28|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1114| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 29|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1112| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 30|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1102| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 31|</font>
<br><font size=4 face="Courier New">| &nbsp; &nbsp; &nbsp; &nbsp; 1696|
&nbsp; &nbsp; &nbsp; &nbsp; 1101| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 32|</font>
<br><font size=4 face="Courier New">+-------------+-------------+-------------+</font>
<br><font size=4 face="Courier New">(32 rows)</font>
<br><font size=4 face="Courier New">continue</font>
<br><font size=4 face="Courier New">* * * * *</font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Allan Biggs &lt;Allan.Biggs@GBR.dupont.com&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">martin.bowes@ndph.ox.ac.uk</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Cc: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">&quot;info-ingres@lists.planetingres.org&quot;
&lt;info-ingres@lists.planetingres.org&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">06/02/2017 16:10</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [Info-ingres]
One up unique number for an attribute - in SQL - does anyone know the trick
of doing this?</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Sent by: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">info-ingres-bounces@lists.planetingres.org</font>
<br>
<hr noshade>
<br>
<br>
<br><font size=2 face="sans-serif">Martin,</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
Thanks for this - I don't have 10.2 documentation on my PC and the ESD
site seems to be down or very busy this afternoon so was unable to look
it up.</font><font size=3> <br>
</font><font size=2 face="sans-serif"><br>
The number of times I have needed to do this and struggled with internal
procedures &nbsp; :-) </font><font size=3><br>
</font><font size=2 face="sans-serif"><br>
cheers <br>
Allan</font><font size=3> <br>
<br>
<br>
</font><font size=1 color=#5f5f5f face="sans-serif"><br>
From: &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=1 face="sans-serif">Martin
Bowes &lt;martin.bowes@ndph.ox.ac.uk&gt;</font><font size=3> </font><font size=1 color=#5f5f5f face="sans-serif"><br>
To: &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=1 face="sans-serif">Allan
Biggs &lt;Allan.Biggs@GBR.dupont.com&gt;</font><font size=3> </font><font size=1 color=#5f5f5f face="sans-serif"><br>
Cc: &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=1 face="sans-serif">&quot;info-ingres@lists.planetingres.org&quot;
&lt;info-ingres@lists.planetingres.org&gt;</font><font size=3> </font><font size=1 color=#5f5f5f face="sans-serif"><br>
Date: &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=1 face="sans-serif">06/02/2017
15:47</font><font size=3> </font><font size=1 color=#5f5f5f face="sans-serif"><br>
Subject: &nbsp; &nbsp; &nbsp; &nbsp;</font><font size=1 face="sans-serif">RE:
[Info-ingres] One up unique number for an attribute - in SQL - does anyone
know the trick of doing this?</font><font size=3> <br>
</font>
<hr noshade><font size=3><br>
<br>
</font><font size=2 color=#004080 face="Calibri"><br>
Create the table using an identity column or have the column take a column
default which is the next value from a sequence.</font><font size=3> </font><font size=2 color=#004080 face="Calibri"><br>
 </font><font size=3>&nbsp;</font><font size=2 color=#004080 face="Calibri"><br>
Martin Bowes</font><font size=3> </font><font size=2 color=#004080 face="Calibri"><br>
 </font><font size=3>&nbsp;</font><font size=2 face="Tahoma"><b><br>
From:</b> Allan Biggs [</font><a href=mailto:Allan.Biggs@GBR.dupont.com><font size=2 color=blue face="Tahoma"><u>mailto:Allan.Biggs@GBR.dupont.com</u></font></a><font size=2 face="Tahoma">]
<b><br>
Sent:</b> 06 February 2017 15:42<b><br>
To:</b> info-ingres@lists.planetingres.org; openroad-users@googlegroups.com<b><br>
Subject:</b> [Info-ingres] One up unique number for an attribute - in SQL
- does anyone know the trick of doing this?</font><font size=3> </font><font size=3 face="Times New Roman"><br>
 </font><font size=3>&nbsp;</font><font size=2 face="Arial"><br>
in command line sql I am populating a new table - one of the columns is
a sort order <br>
<br>
each row of this field &nbsp;<b><u>must</u></b> be a 'one up' unique number
starting at 1 and ending as the number of rows in the table &nbsp;</font><font size=3 face="Times New Roman">
<br>
</font><font size=2 face="Arial"><br>
<br>
I know that I could do this in OpenROAD , and in another guise this is
done in OpenROAD, &nbsp;but in this case it has to be done in SQL or maybe
in report writer.</font><font size=3 face="Times New Roman"> </font><font size=2 face="Arial"><br>
<br>
It does not matter &nbsp;which rows contain &nbsp;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. &nbsp;</font><font size=3 face="Times New Roman">
</font><font size=2 face="Arial"><br>
<br>
Does anyone know of a 'trick' to do this?</font><font size=3 face="Times New Roman">
</font><font size=2 face="Arial"><br>
<br>
In mysql it is possible to define unique one up numbers when creating a
table does modern Ingres have this feature?</font><font size=3 face="Times New Roman">
</font><font size=2 face="Arial"><br>
<br>
thanks <br>
Allan &nbsp;</font><font size=3> </font>
<p><font size=3 face="Times New Roman"><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 &quot;E-Contract Intended&quot;, 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.</font><font size=3> </font>
<p><font size=3 face="Times New Roman">Francais Deutsch Italiano &nbsp;Espanol
&nbsp;Portugues &nbsp;Japanese &nbsp;Chinese &nbsp;Korean</font><font size=3>
</font>
<p><font size=3 face="Times New Roman">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
</font><a href=http://www.dupont.com/corp/email_disclaimer.html><font size=3 color=blue face="Times New Roman"><u>http://www.DuPont.com/corp/email_disclaimer.html</u></font></a><font size=3>
</font>
<p><font size=3><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 &quot;E-Contract Intended&quot;, 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.</font>
<p><font size=3>Francais Deutsch Italiano &nbsp;Espanol &nbsp;Portugues
&nbsp;Japanese &nbsp;Chinese &nbsp;Korean</font>
<p><font size=3>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </font><a href=http://www.dupont.com/corp/email_disclaimer.html><font size=3>http://www.DuPont.com/corp/email_disclaimer.html</font></a><tt><font size=2>_______________________________________________<br>
Info-ingres mailing list<br>
Info-ingres@lists.planetingres.org<br>
</font></tt><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.planetingres.org_mailman_listinfo_info-2Dingres&amp;d=DwICAg&amp;c=zRqMG_fghhK--2M6Q5UUdA&amp;r=NR3Ih16COg3iVzf1V6AnysHgZxJHe-pkPnBl5lbRPSY&amp;m=3TRWI_SdqoEFSGsaGPVNrYFAj-iNOI5Hh5ejTQBhgw0&amp;s=dtdelW38-9MDir9yps2RH3oMCDRk6AMy6P3NvlOOuVE&amp;e="><tt><font size=2>https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.planetingres.org_mailman_listinfo_info-2Dingres&amp;d=DwICAg&amp;c=zRqMG_fghhK--2M6Q5UUdA&amp;r=NR3Ih16COg3iVzf1V6AnysHgZxJHe-pkPnBl5lbRPSY&amp;m=3TRWI_SdqoEFSGsaGPVNrYFAj-iNOI5Hh5ejTQBhgw0&amp;s=dtdelW38-9MDir9yps2RH3oMCDRk6AMy6P3NvlOOuVE&amp;e=</font></tt></a><tt><font size=2>
<br>
</font></tt>
<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.</p>


<p>Francais Deutsch Italiano&nbsp; Espanol&nbsp; Portugues&nbsp; Japanese&nbsp; Chinese&nbsp; Korean</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  http://www.DuPont.com/corp/email_disclaimer.html</p>