ConfigMgr 2012: Quick Model Count in SQL
From the archive (2015). Written for the tools of the time, so some details may be out of date.
Here is just a quick SQL query you can use to show how many of each model you have in your environment. I’ve got a Manufacturer filter on it, but you could remove that or modify as necessary.
1: SELECT
2: C.Model0,
3: COUNT(*) AS 'Count'
4: FROM
5: dbo.v_gs_computer_system C
6: WHERE
7: C.Manufacturer0 like '%lenovo%'
8: GROUP BY
9: C.Model0
10: ORDER by Count