Functions for random sampling

The function for random sampling is implemented by the RANDOM_SAMPLING stored procedure.

All stored procedures consist of a mandatory one-string parameter that contains pairs of <parameter>=<value> entries. These entries are separated by a comma. The data type of the parameter is VARCHAR(any).

Valid <parameter>=<value> entries are listed in the parameter descriptions for each stored procedure.

By using the RANDOM_SAMPLE procedure, you can:

  • Create random samples with a specified number of rows from a table with replacement.
  • Create random samples with a specified number of rows from a table without replacement.
  • Create stratified samples by indicating the column for which the distribution of the values is kept in the samples.
  • Specify the probability of each row that is to be in the sample.
  • Specify the columns of the input table that are to be kept in the sample.