Re: Select all odd/even records.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Joe Celko (jcelko212_at_earthlink.net)
Date: 06/11/04


Date: Fri, 11 Jun 2004 12:27:28 -0700


>> Assume i have a table with 100 records [sic]. How can i select all
odd records [sic] (i.e. record [sic] 1, 3, 5...) or even records
[sic](i.e. 2, 4, 6)? <<

Let's get back to the basics of an RDBMS. Rows are not records; fields
are not columns; tables are not files; there is no sequential access or
ordering in an RDBMS, so "first", "next" and "last" are totally
meaningless.

Want to try again with DDL and a question that makes sense?

--CELKO--
 ===========================
 Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, datatypes, etc. in your
schema are.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



Relevant Pages

  • Re: Row sequence number
    ... Let's get back to the basics of an RDBMS. ... are not columns; tables are not files; there is no sequential access or ... cursor or in an OVERclause. ... You are making a fool of yourself by not knowing the basics. ...
    (comp.databases.ms-sqlserver)
  • Re: Record , Row number
    ... Let's get back to the basics of an RDBMS. ... are not columns; tables are not files; there is no sequential access or ... Please stop writing code ...
    (comp.databases.ms-sqlserver)
  • Re: Finding Position in the Record
    ... Let's get back to the basics of an RDBMS. ... are not columns; tables are not files; there is no sequential access or ... constraints, Declarative Referential Integrity, datatypes, etc. in your ...
    (microsoft.public.sqlserver.programming)
  • Re: Using While Loop to Union Selects?
    ... Please follow basic netiquette and post DDL. ... SQL and RDBMS ... read a book on basics! ... sequential file structures,look at: ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL to combine columns
    ... Please post DDL, so that people do not have to guess ... It is the foundation of RDBMS, ... Since, my application is small and does very basic SQL usage, the internet provided all the information I needed, but a book would have answered my question so the might CELKO would not have been bothered. ... (owner_id INTEGER NOT NULL PRIMARY KEY, ...
    (comp.databases.ms-sqlserver)