Bekijk dit .
Wijzig uw zoekopdracht in:
SET @rank=0;
SELECT @rank:[email protected]+1 AS rank, itemID, COUNT(*) as ordercount
FROM orders
GROUP BY itemID
ORDER BY ordercount DESC;
SELECT @rank;
De laatste selectie is je telling.
Bekijk dit .
Wijzig uw zoekopdracht in:
SET @rank=0;
SELECT @rank:[email protected]+1 AS rank, itemID, COUNT(*) as ordercount
FROM orders
GROUP BY itemID
ORDER BY ordercount DESC;
SELECT @rank;
De laatste selectie is je telling.