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
You need to do -
SELECT COUNT(*) FROM ( SELECT DISTINCT component FROM `multiple_sample_assay_abc` WHERE labref = 'NDQA201303001' ) AS DerivedTableAlias
You can also avoid subquery as suggested by @hims056 here