Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2003

    Lightbulb Unanswered: Quick method to determine relative position of the index entry

    I have a large table with some indexes.
    And I have a value for an indexed field. So I'd like to get the order of the first entry of this value in a specified index.

    I'd like to write a stored procedure, which returns such number for given value and index name.

    How can I do it?

  2. #2
    Join Date
    Apr 2003

    Thumbs up

    I have found a quik decision!

    select count(distinct indexed_col_name)
    from Table
    where index_col_name < value

    Other ideas (with Cursor , for example) are slower.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts