Examples on how to use row_number and rank
SELECT
ROW_NUMBER() OVER (ORDER BY ct_id) AS row_num,
ROW_NUMBER() OVER (PARTITION BY source_id ORDER BY ct_id) AS partitioned_row_num,
RANK() OVER (ORDER BY ct_id) AS row_num,
RANK() OVER (PARTITION BY source_id ORDER BY ct_id) AS partitioned_row_num
FROM
ct_pstor