Maybe a beginners question. Is there a way I can limit the number of records returned from a database?
E.g. Database Name - News
Return the last 5 records
Records 1 2 3 4 5 6
Returns 6 5 4 3 2
Help an idiot
It depends on which dbms you are using. Assuming you are using MySQL you can do it like this -
SELECT id FROM news ORDER BY id DESC LIMIT 5
Hope this helps 😉