From: | "Michael Ansley (UK)" <Michael(dot)Ansley(at)intec-telecom-systems(dot)com> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org, "'pmiranda(at)vm(dot)com(dot)br'" <pmiranda(at)vm(dot)com(dot)br> |
Subject: | RE: Re: Top |
Date: | 2001-08-08 08:54:32 |
Message-ID: | 7F124BC48D56D411812500D0B747251480F662@fileserver002.intecsystems.co.uk |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anyway, it's a combination of ORDER BY and LIMIT:
SELECT * FROM table1 ORDER BY field1 DESC LIMIT 10;
or, if you want the bottom ten:
SELECT * FROM table1 ORDER BY field1 LIMIT 10;
Or, if you want the next ten:
SELECT * FROM table1 ORDER BY field1 LIMIT 10, 10;
or something to that effect.
MikeA
>> -----Original Message-----
>> From: Colin 't Hart [mailto:cthart(at)yahoo(dot)com]
>> Sent: 08 August 2001 08:17
>> To: pgsql-admin(at)postgresql(dot)org
>> Subject: [ADMIN] Re: Top
>>
>>
>> > Please, does anyone know if is there in Postgres's SQL language
>> > an equivalent for Oracle's TOP ?
>>
>> Ummm, Oracle's SQL doesn't have a TOP.
>>
>> Are you thinking of SQL Server?
>>
>>
>> Cheers,
>>
>> Colin
>>
>>
>>
>>
>> ---------------------------(end of
>> broadcast)---------------------------
>> TIP 1: subscribe and unsubscribe commands go to
>> majordomo(at)postgresql(dot)org
>>
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBO3D+BXympNV/C086EQLevwCgpxcbIiA4OWcjmXQhirB0g4Ts4wEAnjSv
WxaprcluB2uhv5gmtaM6rCbI
=jPE0
-----END PGP SIGNATURE-----
From | Date | Subject | |
---|---|---|---|
Next Message | Gary Stainburn | 2001-08-08 09:06:02 | Re: upgrading RPM query |
Previous Message | Colin 't Hart | 2001-08-08 07:16:47 | Re: Top |