mysqlasp.net.netpaginationado.net

Retrieve 10 records from MySQL?


What is the logic to retrieve last 10 records from MySQL database in ASP.NET page?


Solution

  • It's actually fairly simple just use the following sql(id is the primary auto incrementing key you can use another field as long as that field is in order)

     SELECT * FROM Table ORDER BY id desc LIMIT 0, 10