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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 :-) > > ------------------------------------------------------------------------ > > > |