Random Sample in DB2 and DB2/400? 
Author Message
 Random Sample in DB2 and DB2/400?

Hi

I have a question regarding a feature found in other DBMS, and I'm trying to
find out if it's in DB2 and DB2/400.

The function I'm looking for is random sampling.  In Oracle, there is a
function called SAMPLE(<percent>) where <percent> is percentage of the
number of rows from a table.  These records are selected at random.  (Hence
the {*filter*} name, whee!)

If such a feature exists within DB2, I'd like to know:
    1.  Does it exist within DB2/400 as well?
    2.  What is the syntax for the function?  Does it differ from the
example I've given?
    3.  When did this feature start being supported (DB2 and DB2/400
version)?

Thanks!

-Doc



Sun, 06 Jul 2003 01:29:27 GMT
 Random Sample in DB2 and DB2/400?

Hi

Sorry, can't talk about initial releases or DB2/400...

How about using the RAND function as in

SELECT somecols FROM sometables WHERE RAND() * 100 < percent

Joachim Banzhaf, Lis.Tec GmbH
DB2 Consultant



Quote:
> Hi

> I have a question regarding a feature found in other DBMS, and I'm trying
to
> find out if it's in DB2 and DB2/400.

> The function I'm looking for is random sampling.  In Oracle, there is a
> function called SAMPLE(<percent>) where <percent> is percentage of the
> number of rows from a table.  These records are selected at random.
(Hence
> the {*filter*} name, whee!)

> If such a feature exists within DB2, I'd like to know:
>     1.  Does it exist within DB2/400 as well?
>     2.  What is the syntax for the function?  Does it differ from the
> example I've given?
>     3.  When did this feature start being supported (DB2 and DB2/400
> version)?

> Thanks!

> -Doc



Mon, 07 Jul 2003 21:37:16 GMT
 Random Sample in DB2 and DB2/400?

The RAND function was made available in DB2/400 V4R5
--
Kent Milligan, DB2 & BI team
PartnerWorld for Developers, iSeries

(opinions stated are not necessarily those of my employer)



Tue, 08 Jul 2003 00:16:53 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. desire to move data from OS 390 DB2 to AS/400 DB2 using DTS

2. DB2 Newbie: Connecting to AS/400 DB2 with JDBC problems

3. db2/400 vs. db2/Solaris

4. DB2 UDB 7.2 and DB2 UDB for AS/400 V5R1

5. Difference between DB2 UDB 7.2 and DB2/400

6. DB2/400 to DB2 for Linux

7. Accessing DB2 on AS/400 by DB2-Connect

8. DB2 Connect and DB2 OS/400

9. DB2/400 and DB2 Connect

10. DB2 on linux vs. DB2 on AS/400

11. DB2 on AS/400 with DB2 Connect

12. Adding db2(AS/400) to cc on db2(linux)


 
Powered by phpBB® Forum Software