Results 1 to 16 of 16
Apr 9, 2012, 01:33 #1
MySQL: Getting the record number?
Suppose I have a query:
SELECT * FROM users ORDER BY user_id DESC
What I want to know is, is it possible (in MYSQL) to know whats the record number for the user_id 50?
I know I can run a loop in my php script and start a counter and get the record number with simple if() condition, but if there are 8000 records in my table, I dont want to iterate thru all the 8000 records...hence looking for an efficient SQL Query.