Re: id record for each table

From: Steve Kass (skass_at_drew.edu)
Date: 07/15/04


Date: Wed, 14 Jul 2004 22:05:40 -0400

No [rowid]-like column is exposed to users. If you have a natural order
based on column values of the table, you can use it to find the row with
particular rank according to that order. For example, to find the 123rd
row ordering the rows by colA, colB descending, colC, where (colA, colB,
colC) is unique, this would work:

select top 1 * from (
  select top 123 *
  from T
  order by colA, colB desc, colC
) T123
order by colA desc, colB, colC desc

Aside from orderings based on values in the table, there is no hidden
physical ordering of the rows in a table to access.

Steve Kass
Drew University

Enric wrote:

>Dear all,
>
>I think that it exists and I'm not dreaming. No identity field but just a internal flag or hide field which computes each record.
>
>'Id record'
>
>Any help will be very well received,
>
>
>



Relevant Pages

  • Re: PHP/MySQL - Splitting similar data to two tables and querying as a whole
    ... > data - previous years stuff, which is only used in queries <5% of the ... select colA, colB, colC ...
    (comp.lang.php)
  • Re: Query Error
    ... INSERT INTO (colA, colB, colC) ... but I am getting an error message: runtime error 3134: SYNTAX ERROR IN INSERT INTO statement. ...
    (microsoft.public.access.queries)
  • Re: converting from long to double
    ... decimals). ... Append query - like this (say colC is the converting column): ... SELECT colA, colB, Val ...
    (comp.databases.ms-access)
  • Re: Join on alias field values on-the-fly
    ... Ohh becuase we can have a scenario where there is other things in ColC ... where ColA and ColB match. ... So use that in your join: draw a line from ColA to ColA, and from ColB ...
    (comp.databases.ms-access)
  • Re: Optimizer Issues with 10.00.xC8
    ... That would sidestep the low selectivity of the colC index. ... We have some queries that search based on ColA, some that search based on ColA and ColC combined, and some that search on ColC alone. ... I, and several other customers, complained about the problem and one of the big advances in the optimizer in 7.31/9.30 was for the engine to delay the final calculations of cost for these queries until it had the replacement values at cursor open/execute time. ... this _only_ appears to be the case if there are distributions on the table. ...
    (comp.databases.informix)