I’m trying to work out how to make this view for my database
The number of meters read in the current month by each of the meter
readers (this view should be able to be used at any time without having to
be changed to accommodate the date).
The main trouble I’m having is counting how many times the employee has read a meter in the month. I’m using oracle and sql developer.
These are my tables:
a2_METERREADER
- EMPLOYEEID
- FIRSTNAME
- LASTNAME
a2_READING
- READINGID
- METERID
- EMPLOYEEID
- BILLNUMBER
- READING
- DATERECORD
a2_Watermeter
- METERID
- ADDRESS
- SUBURB
- POSTCODE
- STATUS
- CUSTOMERID
- REPLACE
- INSTALLDATE
You need to join the meter reader and reading tables and count the number of rows, grouped by employee for the month in question.
Something along these lines: