O'Reilly logo

Tera-Tom's 1000 page e-Book on Teradata by Tera-Tom Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 35

The SAMPLE Function

“The universe extends beyond the mind of man, and is more complex than the small sample one can study,”

– Kenneth L. Pike

   Table of Contents Chapter 35 – The SAMPLE Function

The SAMPLE Function and Syntax

SAMPLE Function Examples

A SAMPLE Example that asks for Multiple Samples

A SAMPLE Example with the SAMPLEID

A SAMPLE Example WITH REPLACEMENT

A SAMPLE Example with Four 10% Samples

A Randomized SAMPLE

A SAMPLE with Conditional Logic

Aggregates and A SAMPLE using a Derived Table

Random Number Generator

Using Random to SELECT a Percentage of Rows

Using Random and Aggregations

The SAMPLE Function and Syntax

The syntax for the SAMPLE function:

    SAMPLE [ WITH REPLACEMENT ] [ RANDOMIZED ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required