I have two tables, TABLE1 and TABLE2, each containing the total amount of cash bills in a cash register for a given day in a given building. Each table is a data snapshot taken at a certain time during the day.
I want to list only the rows on which there is a difference in the amount of bills (any bill difference) in the same cash register for the same building for the same date. Cash register IDs are only unique for the building in which they are contained.
The purpose is to find out which cash registers in which buildings contained a different amount of bills during the later snapshot (TABLE2) for the same day.
The data structure of both TABLE1 and TABLE2 is:
Column Type Comment
ID NUMBER(10,0) -- Serial
DAY DATE(7) -- The date
BUILDING_ID NUMBER(10,0) -- The ID of the building
REGISTER_ID NUMBER(10,0) -- The ID of the cash register (unique per building ID)
BILL5 NUMBER(10,0) -- The number of 5 dollar bills
BILL10 NUMBER(10,0) -- The number of 10 dollar bills
BILL20 NUMBER(10,0) -- The number of 20 dollar bills
BILL50 NUMBER(10,0) -- The number of 50 dollar bills