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
Select labref , component ,Count(*) as Counts From xyz Group by labref , component