...
Here is an example of a query that shows two srs_id records that correspond to one instance record on the folio_source_record.marc _ _ t table along with the result. Note the join from the inventory table to the marc _ _ table. It isolates just one instance_hrid in the WHERE clause. The result shows one instance_hrid record associated with two srs_id records. One srs_id record shows a state of 'ACTUAL,' and the other shows a state of 'OLD'. This results in inflated record counts.
Sample
...
2 -- query shows a marc__t table instance_id with two srs_id's, one OLD and one ACTUAL:
SELECT DISTINCT
instance_ext.instance_hrid,
marc__t.instance_id,
marc__t.srs_id,
records_lb.state
...
WHERE instance_ext.instance_hrid = '11023049'
Result:
And if we wanted to show the WHERE condition “records_lb.state = ‘ACTUAL’ “ we could add it onto the same query as follows. Using 'ACTUAL' in the WHERE clause results in one srs_id associated with one instance_hrid. The count of records is no longer inflated.
Sample 3: query shows how to get just the ACTUAL version of the record:
SELECT DISTINCT
instance_ext.instance_hrid,
marc__t.instance_id,
marc__t.srs_id,
records_lb.state
...
WHERE instance_ext.instance_hrid = '11023049'
and records_lb.state = 'ACTUAL'
Result:

