Count where previous record exists in either of two tables
Inner join on counting_table.bigint-1 = other_table.bigint and counting_table.char = other_table.char

SELECT * 
FROM counting_table t1 
INNER JOIN other_table t2 
    ON t1.bigint_column-1 = t2.bigint_column 
    AND t1.character_column=t2.character_column