select the first and the last two elements

Posted by Luca Romagnoli on Stack Overflow See other posts from Stack Overflow or by Luca Romagnoli
Published on 2010-04-07T21:59:54Z Indexed on 2010/04/07 22:03 UTC
Read the original article Hit count: 495

Filed under:
|

hi i have a table with this elements

id name
1 luke
2 johnny
3 perry
4 jenny
5 mark

I have to do a query that take the first element and the lasts 2 i this example

1 luke
4 jenny
5 mark

how can i do?

thanks

© Stack Overflow or respective owner

Related posts about mysql

Related posts about select