count rows in one table that is related to another table
I have a systems table which contains a "systemtype" , "narserno". also I have a luns table which has "narserno" and luninfo field.
for each systemtype, I want to count total in the systems table where luninfo in the luns table contains a key work of "oracle".
I have this query, but it doesnt look right (too many value returns), could you one point out where my problem is:
select systemtype, count(l.luninfostring) counts from systemconfig s, lunperformancesummary l
where s.narserno=l.arrayid and l.luninfostring like '%oracle%' group by systemtype
order by counts desc;
Thanks,
CP
0