sql_mode=only_full_group_by ayarının default olduğunu varsayarak şu kodu yazıyorum:

select max(Code) as Code, max(Definition), max(Descr), count(code) from test where Descr like '%CARTONS%' group by Code order by count(Code) DESC;
Ekran çıktısı şöyle olur. En üste en çok CARTONS içeren veriyi koyar, sağlaması için count(code) ekledim.


Bir tık performansa etki eder. Eğer sql_mode değeriniz içinde only_full_group_by yoksa sorgu daha basitleşir:
select Code, Definition, Descr FROM test where Descr like '%CARTONS%' group by Code order by count(Code) DESC