get the last 5000 entries of the table [duplicate]
i currently have the following query
SELECT name, bio, original_username FROM indo_accounts_data WHERE id > 180000 ORDER BY RAND() LIMIT 5000
instead of doing a random 5000, i want to query the last 5000 entries of the table.. so say the table has id 1 to 1000000, i wanted to get row 995000 till 1000000 , how do i do so in a single query ? is it possible ?
Order desc on the auto increment key
SELECT name, bio, original_username FROM indo_accounts_data
ORDER BY id desc
LIMIT 5000