Re: Informix SQL question !!!
Posted in 1996
Topics: General Discussion
Giuliano Ferraro wrote: > > I'm coming from Oracle database and I need to port some tool to Informix. > In Oracle SQL I have a query like this: > > SELECT > ROWNUM, COLUMN-1, COLUMN-2, ..., COLUMN-c > FROM > TABLE-1, TABLE-2, ..., TABLE-t > WHERE > CONDITIONS > > where the first column ROWNUM is a system column managed by Oracle > and it contains the ordinal number of the row retrieved by SELECT. In > short, I use this column to enumerate the result set of the SELECT > statement. > How could do the same in Informix SQL? Each Informix table has a column called ROWID, which gives a unique number to each row. This value should not be used as a reference to a specific row. You should use the primary key for this purpose. But it can be used as you describe. Hope this helps, -- Mark. +-------------------------------------------------------------------------+ |Mark D. Stock - The West Solutions Group http://www.west.co.za | | The Informix FAQ is at http://www.iiug.org | |mailto:marks@west.co.za +------------------------------------------------+ |Tel: +27 11 803 2151 |If it doesn't work... force it! | |Fax: +27 11 803 2189 |If it breaks... it needed replacing anyway! | |Cell: +27 83 250 2325 |Well, that's how I code anyway! | +------------------------+------------------------------------------------+