I have two tables :
A --> Table with rows
B ---> Table with chunk id, rowid_start , rowid_end
How do I find the count(*) of rowids in A where rowid between start and end in table B and do that for all chunk_ids in B. ?