Thread: Re: [SQL] LIMIT
<tt>Mark Jewiss ha scritto:</tt><blockquote type="CITE"><tt>> > Could someone give me an example of a select * withLIMIT</tt><br /><tt>> > used by 6.5?</tt><br /><tt>></tt><br /><tt>> SELECT * FROM foobar LIMIT 100</tt><tt></tt><p><tt>Oryou could use ROWCOUNT...</tt><tt></tt><p><tt>set rowcount = 10</tt><br /><tt>select * from table</tt><tt></tt><p><tt>Regards,</tt><tt></tt><p><tt>Mark.</tt><br/><tt>--</tt><br /><tt>Mark Jewiss</tt><br /><tt>KnowledgeMatters Limited--------------------------------------------------------------</tt></blockquote><tt></tt><p><br/><tt>I don't knownothing about ROWCOUNT.</tt><br /><tt>SET ROWCOUNT doesn't work for me.</tt><br /><tt>hygea=> set rowcount = 10;</tt><br/><tt>ERROR: parser: parse error at or near "10"</tt><tt></tt><p><tt>PostgreSQL still accepts SET QUERY_LIMITbut it doesn't work...</tt><tt></tt><p><tt>hygea=> set query_limit to '1';</tt><br /><tt>SET VARIABLE</tt><br/><tt>hygea=> select * from contatori;</tt><br /><tt>tipologia|tabella |contatore|contatorebis</tt><br/><tt>---------+---------------+---------+------------</tt><br /><tt>SOTTO |Modena | 1| 2</tt><br /><tt>SOPRA |prestazioni | 20|</tt><br /><tt>(2 rows)</tt><br/><tt>--------------------------------------------------------------</tt><br /><tt>PostgreSQL 6.5.0 on i586-pc-linux-gnu,compiled by gcc 2.7.2.3</tt><br />-----------------------------------------------------------------------------------<br />José
> 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.
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'