Monday, March 12, 2012

Getting one row from a clustered date table

Is it possible to efficiently pull one row from a table that is clustered by the date. What i want to do is pull one row wheather it be the first row the 1028th row or row 3000. Is this possible to do?

What I have is:
SELECT * FROM CUST WHERE '?' = 3000

My cust column is already in order because it is clustered.that query will be efficient only if the '?' column has an index

(that's not the real name of the column, is it?)

also, first, you say clustered by date, and then you say clustered by cust -- that's not possible, because a table can have only one clustered index|||OH sorry CUST is the table and i have a date column that clustered. I do have an index "CUST_ID" but this column is not ordered like the date column. When I view the table the CUST_ID values are scattered i am not sure why.

Also, one more question is there any kind of limit to how many tables i can have in one database?|||of course the CUST_ID values are scattered -- the rows are in sequence by date

No comments:

Post a Comment