Re: rows

From: Ed Seedhouse (eseedhouse_at_510shaw.ca)
Date: 12/05/03


Date: Fri, 05 Dec 2003 14:45:27 GMT

On Fri, 05 Dec 2003 10:18:19 +0100, RvD <ik@daar.ergens> wrote:

>> SELECT * FROM table ORDER BY id LIMIT 1
>> SELECT * FROM table ORDER BY id DESC LIMIT 1

>Is there no fuction wich selects the first or last row?

Well, what do you mean by "last row"? Relational databases aren't
supposed to have "first" and "last" rows in any physical sense. The
first and last rows are a logical construct determined by the index in
effect, not a physical one.

Order of storage on the disk is irrelevant and in a relational
database system isn't supposed to be even available to the user. In
fact if there is a defined order for storage then the database isn't
relational.

The SQL given above does what you want so far as I can see. If that
isn't what you want, then you should make what you want clearer.

Ed



Relevant Pages

  • Re: Problems with querying date field
    ... >> If you want to put a database somewhere for safekeeping, ... database - SQL isn't about persistence, ... says nothing about the physical storage media to be used. ... store data on a tape, or a disk, or a CD, or a file, or any physical ...
    (microsoft.public.sqlserver.programming)
  • Re: Implementing SQL on files
    ... I am not an SQL fan either. ... is about database like storage simantics in the filesystem. ... primitives to be more general - are implemented in the kernel ...
    (Linux-Kernel)
  • Re: Capacity Issues with SQL
    ... So go for 3 Servers. ... > We're running a bespoke CRM tool running SQL as its backend. ... > create too much extra storage, ... > processor to cover the database. ...
    (microsoft.public.windows.terminal_services)
  • Re: separate doc storage server
    ... This is a SQL setup issue not a SharePoint issue. ... SharePoint is stored in a database and if you put that database on a sql ... storage solution and put your SQL sharepoint databases on the NAS. ...
    (microsoft.public.sharepoint.portalserver)
  • Re: dbdebunk Quote of Week comment
    ... > a lot of really bad SQL programmers. ... But SQL does not have a pointer data type or the ... > being told to design a database. ... But why is little Cindy Lou Who employee ...
    (comp.databases.theory)