| List: | MySQL on Win32 | « Previous MessageNext Message » | |
| From: | Steve Ruby | Date: | January 8 2001 8:47pm |
| Subject: | Re: 5 last records ? | ||
| View as plain text | |||
FL wrote: > > Hi, > > How to build an efficient query to display the 5 last records (order by > date) ? You can only display the "last" 5 ordered by date ASCENDING if you know the total number of rows, otherwise you can cheat by sorting DESCENDING and viewing the first 5.. select * from <tablename> order by <datecolumn> desc limit 5;
| Thread | ||
|---|---|---|
| • mysql_affected_rows() reportedly returns 0 for queries on BDBtables | Cynic | 8 Jan |
| • 5 last records ? | FL | 8 Jan |
| • Re: 5 last records ? | Stephen Woodbridge | 8 Jan |
| • Re: 5 last records ? | Steve Ruby | 8 Jan |
| • Re: 5 last records ? | Jorge del Conde | 9 Jan |
| • Re: mysql_affected_rows() reportedly returns 0 for queries onBDB tables | Cynic | 9 Jan |
