select cs.Name0 [Computer name],COUNT(*) as [No of Times]
from v_GS_SoftwareFile SF,v_GS_COMPUTER_SYSTEM cs
where FileName like ‘%.mdf%’ and
SF.ResourceID=cs.ResourceID
group by cs.Name0
order by 2 desc
SCCM Configmgr report:Count specific inventory file on computers is a post from: Eswar Koneti's Blog