0

I have created a table with partition on ID columnPARTITION BY RANGE_N(EmpId BETWEEN 1 AND 10 EACH 1 );. I want to check specific partition data. For example partition 1 total number of rows 10, partition 2 total rows 5. is there a way to check this in teradata.

Partition_No  row_count
P1              10
P2               5
P3              20
Alia
  • 33
  • 5
  • You can refer to system-derived column PARTITION in your SQL. – Fred Sep 26 '22 at 14:37
  • @Fred - You can select and group by using .PARTITION#L1? Or whatever level of the partition is appropriate.
    – Andrew Sep 26 '22 at 15:32
  • Yes - combined PARTITION or PARTITION#L1 etc. level (for MLPPI) can be used as column references. If the partitioning is 2-byte then the result is INTEGER or for 8-byte partitioning result will be BIGINT. – Fred Sep 27 '22 at 12:30
  • You can do something like this. `SELECT PARTITION, COUNT(*) FROM tbl GROUP BY PARTITION` – Kota Mori Sep 29 '22 at 12:14

0 Answers0