SQL for Smarties | SQL Programming Style | Trees and Hierarchies in SQL | SQL Puzzles and Answers | Data and Databases


Thursday, October 04, 2007

How to retrieve all records from 30th record to 50th record of a table?

SQL Apprentice Question
I have a table named myTable. It is sorted by some column and there is
no primery key or unique column.I want to retrieve all records from
30th record to 50th record. How can I do this by a sql statement?



Celko Answers
>> I have a table named myTable. It is sorted by some column and there is no primary key or unique column. <<


BY DEFINITION:
1) Tables have at least one key
2) Tables have no ordering


>> I want to retrieve all records from 30th record to 50th record. <<


1) Rows are not anything like records
2) Tables have no ordering

Please read a book --ANY book -- are RDBMS. You have gotten every
basic concept wrong.




Original Source

No comments: