O'Reilly logo

Teradata SQL by Tom Coffing, Mike Larkins

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 25 - Sample

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

- Kenneth L. Pike

 

The SAMPLE Function and Syntax

The syntax for the SAMPLE function:

SAMPLE [ WITH REPLACEMENT ][ RANDOMIZED ALLOCATION ]

                        [ WHEN <condition> THEN ]                        {<number-of-rows> | <percentage>}

[…,<number-of-rows> | <percentage>]

                         [ ELSE {<number-of-rows> |

<percentage } END ]

The Sampling function (SAMPLE) permits a SELECT to randomly return rows from a Teradata database table. It allows the request to specify either an absolute number of rows or a percentage of rows to return. Additionally, it provides an ability to return rows from multiple ...

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