I have two tables, one that stores serial number uut_build, and another for measurements that belong to the serial numbers measure_list, I’m trying to get the count of records in measure_list that belongs to a unique serial number.
Query #1
select id, uut_sn from uut_build where uut_sn like 'A%';
Query #2
select count(*) from measure_list as m WHERE m.uut_id = [result from query #1]
Is it possible to do this with just one query statement?
Thanks in advance!
Use:
It’s a little unclear what columns link the two tables…
This will return all serial numbers – if they don’t have a record in
MEASURE_LIST, the cnt value will be zero. If you only want a list of records that have records inMEASURE_LIST, remove “LEFT” from the query I provided.