In a table xyz I have a row called components and a labref row which has labref number as shown here
Table xyz
labref component NDQA201303001
Try this simple query without a sub-query:
SELECT COUNT(DISTINCT component) AS TotalRows FROM xyz WHERE labref = 'NDQA201303001';