Code: Select all
CREATE TABLE Example (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
PRIMARY KEY(id),
someNum INT UNSIGNED NOT NULL
UNIQUE INDEX(someNum)
);
Code: Select all
SELECT id FROM Example WHERE someNum = x
How many rows are above this when it is ORDER BY id DESC?
Bare in mind id may not be contigious and someNum is random.