In this case, if the rows were loaded randomly we would expect the number of distinct values for the first three columns in the table to be 2, 5 and 10 respectively. The number of rows we expect can be calculated by multiplying the number of distinct values of each column listed in the GROUP BY clause. This way we get an aggregated value for each distinct combination of values present in the columns listed in the GROUP BY clause. Including the GROUP BY clause limits the window of data processed by the aggregate function. ROUND(DBMS_RANDOM.value(low => 1, high => 100), 2) AS sales_value TRUNC(DBMS_RANDOM.value(low => 1, high => 11)) AS fact_4_id, TRUNC(DBMS_RANDOM.value(low => 1, high => 11)) AS fact_3_id, TRUNC(DBMS_RANDOM.value(low => 1, high => 6)) AS fact_2_id, SELECT TRUNC(DBMS_RANDOM.value(low => 1, high => 3)) AS fact_1_id, ![]() The examples in this article will be run against the following simple dimension table. This article gives an overview of the functionality available for aggregation in data warehouses, focusing specifically on the information required for the Oracle Database SQL Expert (1Z0-047) exam.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |