Hvis OP ønsker at inkludere yderligere information (yderligere aggregeringer osv...) ved hjælp af data fra users
tabel:
SELECT `users`.`id`,
count(`receipts`.`uId`)
FROM `users`
INNER JOIN `receipts` ON `users`.`id` = `receipts`.`uId`
GROUP BY `users`.`id`
ORDER BY count(`receipts`.`uId`) DESC
Ellers kun receipts
tabel er påkrævet...
SELECT `users`.`id`,
count(`receipts`.`uId`)
FROM `receipts`
GROUP BY `receipts`.`uId`
ORDER BY count(`receipts`.`uId`) DESC