Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467

    Unanswered: Understanding the output of the Sample tag.

    setup: 9iDB, W2K

    more setup: table T as 100 rows

    If I say

    select * from T sample(10)

    Should I not expect to see 10 rows? Sometimes I get 10 rows, sometimes 9, sometimes 18 (and many numbers in between).

    The documentation doesn't seem to be real clear on what to expect except the obvious.

    Am I not understanding the usage of Sample correctly?

    PS - tried using the VB tags like Andrew suggests but they did not seem to have any effect. Sorry.
    NOTE: Please disregard the label "Senior Member".

  2. #2
    Join Date
    Dec 2003
    Posts
    1,074
    Found this:

    "...percentage indicates the probability of each row, or each cluster of rows in the case of block sampling, being selected as part of the sample. It does not mean that the database will retrieve exactly sample_percent of the rows of table."

    http://download-west.oracle.com/docs...ents_10002.htm

    -Chuck

  3. #3
    Join Date
    Nov 2003
    Location
    down on the cube farm, left then right then another left
    Posts
    467
    Well Duh!!

    I read the same thing several times. I can only guess I was so confused by what the first lines were trying to communicate that I didn't register the last line.

    However, after about three more reads I even understand what the first part was saying. (No one ever said I had the fastest uptake).

    Thanks for the gentle redirection to the doc.

    Watch for a new thread opening near you soon.
    NOTE: Please disregard the label "Senior Member".

Posting Permissions

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