A co z czymś takim?
SELECT
(CASE WHEN @date <> date THEN @row := @row +1 ELSE @row END) AS rownum,
@date:= date,
date
FROM ( SELECT @row := 0, @date := NOW() ) r, stats
A co z czymś takim?
SELECT
(CASE WHEN @date <> date THEN @row := @row +1 ELSE @row END) AS rownum,
@date:= date,
date
FROM ( SELECT @row := 0, @date := NOW() ) r, stats