Unix Technical Forum

Re: Last and Last-1

This is a discussion on Re: Last and Last-1 within the MySQL General forum forums, part of the MySQL category; --> select idTable ... FROM FaxServer ORDER by DateFaxInsert DESC LIMIT 2 suomi Vittorio Zuccalà wrote: > Hi, > i've ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:07 AM
suomi
 
Posts: n/a
Default Re: Last and Last-1

select idTable ... FROM FaxServer ORDER by DateFaxInsert DESC LIMIT 2

suomi

Vittorio Zuccalà wrote:
> Hi,
> i've a table in a mysql database.
> It has a lot of field and three of them are:
> * A counter: IDTable
> * A date: DateFaxInsert
> * A Number: NumberFaxInsert
>
> I want to obtain the last and the last - 1 IDTable.
>
> If i write:
> SELECT MAX(IDTable) AS IDMax, DateFaxInsert, NumberFaxInsert FROM
> FaxServer GROUP BY DateFaxInsert
>
> is ok but i would like to see MAX and MAX-1 of IDTable...
>
>
> Any idea please?
> Thanks :-)
>
> ------------------------------------------------------------------------
>
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:27 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com