select f."_owner” as “Owner”, f."_file-name" as "Table", count(*)
from pub."_File" f inner join pub."_CDC-Table-Policy" tp on f.rowid = tp."_Source-File-Recid" and tp."_Policy-Instance" = 0 inner join pub."_Cdc-Change-Tracking" ct on f."_File-Number" = ct."_Source-Table-Number" and ct."_Time-Stamp" between ? and ? -- time range parameters from ETL app. group by owner, table; |