sampling from a table

sampling from a table

Post by Hagai Kat » Sun, 31 Dec 1899 09:00:00



Shalom,

I went fishing for some guidance on how to produce a random sample from a
large table, but found nothing specific. Could you please assist me as to
how I can draw a random sample (or any other sampling method: layered,
clustered, etc) from a database? I will be most greatful if you do.


Thank you -

Hagai Katz
Acting Director, The Israeli third-Sector Database,
ICTR - the Israeli Center for Third-sector Research
Ben Gurion University of the Negev,
Beer Sheva, Israel.

 
 
 

sampling from a table

Post by Connor McDonal » Sun, 31 Dec 1899 09:00:00



> Shalom,

> I went fishing for some guidance on how to produce a random sample from a
> large table, but found nothing specific. Could you please assist me as to
> how I can draw a random sample (or any other sampling method: layered,
> clustered, etc) from a database? I will be most greatful if you do.


> Thank you -

> Hagai Katz
> Acting Director, The Israeli third-Sector Database,
> ICTR - the Israeli Center for Third-sector Research
> Ben Gurion University of the Negev,
> Beer Sheva, Israel.

If you're on 8i, there is a SAMPLE clause in SQL to do exactly that.

On releases before this, using rownum combined with a random number
generator can assist although its not too efficient.  A little more
complex but more efficient is to generate pseudo-rowid ranges

HTH
--
===========================================
Connor McDonald
"These views mine, no-one elses etc etc"

"Some days you're the pigeon, and some days you're the statue."

 
 
 

sampling from a table

Post by TurkBe » Sun, 31 Dec 1899 09:00:00


Hi,
I have found that a '*' select statement ( no where clause or order by
clause) will return a 'random' set of records from a table ( Random in this case
meaning in no particular order ) since the 'order' of records stored by Oracle
is random in nature...while this is certainly not a true random sample, I find
it works for most sampling tasks...



>> Shalom,

>> I went fishing for some guidance on how to produce a random sample from a
>> large table, but found nothing specific. Could you please assist me as to
>> how I can draw a random sample (or any other sampling method: layered,
>> clustered, etc) from a database? I will be most greatful if you do.


>> Thank you -

>> Hagai Katz
>> Acting Director, The Israeli third-Sector Database,
>> ICTR - the Israeli Center for Third-sector Research
>> Ben Gurion University of the Negev,
>> Beer Sheva, Israel.

>If you're on 8i, there is a SAMPLE clause in SQL to do exactly that.

>On releases before this, using rownum combined with a random number
>generator can assist although its not too efficient.  A little more
>complex but more efficient is to generate pseudo-rowid ranges

>HTH

  -----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
   http://www.veryComputer.com/       The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including  Dedicated  Binaries Servers ==-----
 
 
 

1. ODBC Samples With Nested Tables

Does someone has ODBC Samples that will allow fetching rows from table that
have columns made of Type ?

Example:

CREATE TYPE Doc_t AS OBJECT (
   doc_id INTEGER,
   name VARCHAR2(512),
   author VARCHAR2(60),
   url VARCHAR2(2000)
);

CREATE TABLE test (F1 INT, F2 Doc_t) ?

I cannot seem to find a way to make it work in ODBC.

MarcM

2. Suppressing all messages from sacego and isql

3. Can timestamp be used to retrieve a sample of a table ?

4. Distibuting SQL-DMO

5. Sample ASP connection to northwind SQL sample database.

6. SQLJ or JDBC

7. Sample data for the sample DM model

8. New Client/Server Samples added to the samples collection

9. Request SAMPLE PROGRAM of Insert/Update table using DTS

10. Joins ... Table Samples Given

11. random sampling a table or view

12. Crosstab pivot table sample code?