Anda harus menggunakan variabel dengan nilai awal sama dengan nol dan bertambah 1 untuk setiap baris.Coba kueri berikut
SELECT @n:[email protected]+1 as rank,username,count(*) as description
FROM products,(SELECT @n:= 0) AS num
WHERE
description LIKE '%Yes%'
or
description LIKE '%yes%'
GROUP BY username
ORDER BY description ASC