LIMIT

Started by Mr. Poetover 26 years ago9 messages
#1Mr. Poet
poet@linuxports.com

Could someone give me an example of a select * with LIMIT used
by 6.5?
--poet@linuxports.com--
ICQ: 33017215
http://www.linuxports.com
--Power to the Penguin--

#2Chris Bitmead
chris.bitmead@bigfoot.com
In reply to: Mr. Poet (#1)
Re: [SQL] LIMIT

"Mr. Poet" wrote:

Could someone give me an example of a select * with LIMIT
used by 6.5?

SELECT * FROM foobar LIMIT 100

#3Dirk Lutzebaeck
lutzeb@aeccom.com
In reply to: Chris Bitmead (#2)
Re: [SQL] LIMIT

Besides, I have problems with SELECT LIMIT on unions in
6.5beta1. Anyone else?

Dirk

#4Mark Jewiss
mark@office.knowledge.com
In reply to: Chris Bitmead (#2)
Re: [SQL] LIMIT

Could someone give me an example of a select * with LIMIT
used by 6.5?

SELECT * FROM foobar LIMIT 100

Or you could use ROWCOUNT...

set rowcount = 10
select * from table

Regards,

Mark.
--
Mark Jewiss
Knowledge Matters Limited

#5José Soares
jose@sferacarta.com
In reply to: Mr. Poet (#1)
Re: [SQL] LIMIT

Dirk Lutzebaeck ha scritto:

Besides, I have problems with SELECT LIMIT on unions in
6.5beta1. Anyone else?

Dirk

LIMIT doesn't work with UNION, I think this is a known bug.

Jos�

#6José Soares
jose@sferacarta.com
In reply to: Mark Jewiss (#4)
Re: [SQL] LIMIT

Mark Jewiss ha scritto:

Could someone give me an example of a select * with LIMIT
used by 6.5?

SELECT * FROM foobar LIMIT 100

Or you could use ROWCOUNT...

set rowcount = 10
select * from table

Regards,

Mark.
--
Mark Jewiss
Knowledge Matters
Limited--------------------------------------------------------------

I don't know nothing about ROWCOUNT.
SET ROWCOUNT doesn't work for me.
hygea=> set rowcount = 10;
ERROR: parser: parse error at or near "10"

PostgreSQL still accepts SET QUERY_LIMIT but it doesn't work...

hygea=> set query_limit to '1';
SET VARIABLE
hygea=> select * from contatori;
tipologia|tabella |contatore|contatorebis
---------+---------------+---------+------------
SOTTO |Modena | 1| 2
SOPRA |prestazioni | 20|
(2 rows)
--------------------------------------------------------------
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
-----------------------------------------------------------------------------------

Jos�

#7José Soares
jose@sferacarta.com
In reply to: Mark Jewiss (#4)
Re: [SQL] LIMIT

Mark Jewiss ha scritto:

Could someone give me an example of a select * with LIMIT
used by 6.5?

SELECT * FROM foobar LIMIT 100

Or you could use ROWCOUNT...

set rowcount = 10
select * from table

Regards,

Mark.
--
Mark Jewiss
Knowledge Matters Limited

I know nothing about SET ROWCOUNT, it doesn't work for me.
I see v6.5 accepts still SET QUERY_LIMIT TO #
but it doesn't work too.
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'

#8Mark Jewiss
mark@office.knowledge.com
In reply to: José Soares (#6)
Re: [SQL] LIMIT

I don't know nothing about ROWCOUNT.
SET ROWCOUNT doesn't work for me.
hygea=> set rowcount = 10;

Sorry, this is my faul. Correct SQL syntax is

set rowcount 10

Cheers,

Mark.

#9José Soares
jose@sferacarta.com
In reply to: Mark Jewiss (#8)
Re: [SQL] LIMIT

hygea=> set rowcount 10;
ERROR: parser: parse error at or near "10"

Which version of Postgres are you using?

Mark Jewiss ha scritto:

I don't know nothing about ROWCOUNT.
SET ROWCOUNT doesn't work for me.
hygea=> set rowcount = 10;

Sorry, this is my faul. Correct SQL syntax is

set rowcount 10

Cheers,

Mark.

--
______________________________________________________________
PostgreSQL 6.5.0 on i586-pc-linux-gnu, compiled by gcc 2.7.2.3
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Jose'