Board index » delphi » Select Last 10 record ?

Select Last 10 record ?

   I have a squence of the column at bellow, i need to select the last 10
row of this record.
How can i do this ?

 I only find a select Top 10 in the help file. That only make me select the
first 10 row.
So, who can tell me how to do it .

Thank For you time here !

----------------------------------------------------------------------------
----

TotalOut  EmployeeID
-------  ---------

10  0
11  1
12  4
12  7
13  8
14  2
15  12
17  14
18  20
20  3
---Top 10 & Last 10
22  5
22  6
23  9
34  10
35  14
36  11
37  15
38  22
38  30
39  40

2.Select Top
10(TotalOut),EmployeeID,AttendanceDate,Grade
 from AttendanceMaster
  where TotalOut >"00"
  Order by TotalOut

~choong

choon...@email.com

 

Re:Select Last 10 record ?


Hi

Return the FIRST 10

Select Top 10 (TotalOut),EmployeeID,AttendanceDate,Grade
from AttendanceMaster
where TotalOut >"00"
Order by TotalOut

Return the LAST 10

Select Top 10 (TotalOut),EmployeeID,AttendanceDate,Grade
from AttendanceMaster
where TotalOut >"00"
Order by TotalOut DESC

Regards,
   Fernando J.A. Silva (aka ^Magico^)

Quote
"sate" <choon...@hotmail.com> wrote in message news:3aaa121b_1@dnews...
>    I have a squence of the column at bellow, i need to select the last 10
> row of this record.
> How can i do this ?

>  I only find a select Top 10 in the help file. That only make me select
the
> first 10 row.
> So, who can tell me how to do it .

> Thank For you time here !

> --------------------------------------------------------------------------
--
> ----

> TotalOut  EmployeeID
> -------  ---------

> 10  0
> 11  1
> 12  4
> 12  7
> 13  8
> 14  2
> 15  12
> 17  14
> 18  20
> 20  3
> ---Top 10 & Last 10
> 22  5
> 22  6
> 23  9
> 34  10
> 35  14
> 36  11
> 37  15
> 38  22
> 38  30
> 39  40

> 2.Select Top
> 10(TotalOut),EmployeeID,AttendanceDate,Grade
>  from AttendanceMaster
>   where TotalOut >"00"
>   Order by TotalOut

> ~choong

> choon...@email.com

Other Threads