Re: Problem with SQL
Posted in 1991
I believe that the only clean way of handling row ordering in a relational database was never to rely on rowid. This is because in general they are not controllable, especially when you consider the impact of future releases, which may choose a different row insertion/deletion approach, or compatible products, such as Informix-Online, which almost certainly have a different approach. A more portable approach, involving slightly less overhead, is to add a SERIAL column or similar, as suggested. If you then select the use of this index only, by doing a join on this field, you should get the rows in the right order. Relational databases don't in general guarantee the physical ordering of rows, so it's best not to rely on rowids if you can avoid this. Richard =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Richard Donkin Hoskyns Open Systems Division Internet: richardd@inset.co.uk 190 City Road, LONDON EC1V 2QH UUCP: ...!mcsun!ukc!inset!richardd United Kingdom Fax: +44 71 251 2853 Tel: +44 71 251 2128