Question: I wanted to select the last 5 entries of the table except the last entry of the table. I have a table which maintains the details of the weeks of the year. So in order to get the report of the last 5 weeks I have to extract the data from the table. I do not want the data of this week. So how to select the data of last five weeks except this week's data.

Answer: 
Let id be the primary key of your table which is auto-increment. then you can use the following query.

```
SELECT * FROM (
    SELECT * FROM table ORDER BY id DESC LIMIT 6
) sub
ORDER BY id ASC LIMIT 5;

```
If you have same date information in the table you can select the data in a time range:

```
select * from table where date >= [startdate] and date <= [enddate]

```