Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL:Only the last row of an result ?

Re: SQL:Only the last row of an result ?

From: Matthias Gresz <GreMa_at_t-online.de>
Date: 1998/03/18
Message-ID: <6enufd$chd$3@news02.btx.dtag.de>#1/1

On 17 Mar 1998 23:00:46 GMT, svenkunze_at_aol.com (Sven Kunze) wrote: Hi,

assuming you've increasing primary keys in your table, you could do something like:

Select

        t.*
from

	table t,
	(Select 
		max(t1.pk)
	from 	
		table t1
	) t2
where 
	t.pk = t2.pk

;

>Is there a way to get only the last row of a result set.
>
>For example:
>
>Select * from Table1 where Col1 = 'Test' order by Col1
>
>I just need the last record, but using the MoveLast-command in visual Basic is
>VERY slow.
>Sven Kunze.
>
>I use ORACLE 8.0.3.0.0 on NT Server 4.0 (SP3), TCP/IP, and Client NT 4.0 (SP3)
>with Access 2.0 / 97 / Visual Basic 4.0 *(16-Bit) and ODBC 8.0.3.0.0 32-Bit.
>

--

Regards

Matthias Gresz    :-)

GreMa_at_T-online.de
Received on Wed Mar 18 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US