clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3799296 fiddles created (41680 in the last week).

DROP TABLE IF EXISTS yourTable; CREATE TABLE yourTable (id int, name varchar(55), price int, balance int); INSERT INTO yourTable (id, name, price, balance) VALUES (1, 'john', 100, 40), (2, 'dave', 50, 29), (3, 'steven', 29, 200), (4, 'mike', 482, 19), (5, 'clare', 21, 102);
 hidden batch(es)


SELECT id, name, price, balance FROM ( SELECT (@row_number:=@row_number + 1) AS rn, t.* FROM yourTable t, (SELECT @row_number := 0) r ORDER BY balance DESC ) t WHERE rn >= 3 ORDER BY balance DESC;
id name price balance
1 john 100 40
2 dave 50 29
4 mike 482 19
 hidden batch(es)