Re: [SQL] Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)

2008-01-09 Thread Ken Johanson
Paul Lambert wrote: Ken Johanson wrote: I notice PG doesn't allow shorthand column labels -- it requires the 'AS' operand. SELECT col1 foo, ...; -> ERROR: syntax error at or near "foo" Briefly discussed a couple of weeks ago. See http://archives.postgresql.org/pgsql-general/2008-01/msg00089

Re: [SQL] Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)

2008-01-09 Thread Paul Lambert
Ken Johanson wrote: I notice PG doesn't allow shorthand column labels -- it requires the 'AS' operand. SELECT col1 foo, ...; -> ERROR: syntax error at or near "foo" For compatibility with other databases, what objections might be argued in allowing this syntax in the future? On the 'pros' s

[SQL] Shorthand column labels (SELECT col1 foo, ...) vs (SELECT col1 AS foo, ...)

2008-01-09 Thread Ken Johanson
I notice PG doesn't allow shorthand column labels -- it requires the 'AS' operand. SELECT col1 foo, ...; -> ERROR: syntax error at or near "foo" For compatibility with other databases, what objections might be argued in allowing this syntax in the future? On the 'pros' side I think it eases

Re: [SQL] Support for SQL TOP clause?

2008-01-09 Thread Phillip Smith
SELECT * FROM Individual LIMIT 3 I asked the reverse question moving from PG to MSSQL :-( -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chinyi Woo Sent: Thursday, 10 January 2008 14:14 To: pgsql-sql@postgresql.org Subject: [SQL] Support for SQ

[SQL] Support for SQL TOP clause?

2008-01-09 Thread Chinyi Woo
Hello, everyone Does Postgresql support query like SELECT *TOP 3* * FROM Individual ? If I use ORDER BY, I have to write non-sql code to get the first row in the result set, which I try to avoid. Thanks Chinyi

Re: [SQL] Re: How to keep at-most N rows per group? periodic DELETEs or constraints or..?

2008-01-09 Thread Jamie Tufnell
On 1/9/08, Erik Jones <[EMAIL PROTECTED]> wrote: > On Jan 9, 2008, at 1:09 PM, Scott Marlowe wrote: > > On Jan 9, 2008 12:20 PM, Steve Midgley <[EMAIL PROTECTED]> wrote: > >> This is kludgy but you would have some kind of random number test at > >> the start of the trigger - if it evals true once p

Re: [SQL] Re: How to keep at-most N rows per group? periodic DELETEs or constraints or..?

2008-01-09 Thread Erik Jones
On Jan 9, 2008, at 1:09 PM, Scott Marlowe wrote: On Jan 9, 2008 12:20 PM, Steve Midgley <[EMAIL PROTECTED]> wrote: This is kludgy but you would have some kind of random number test at the start of the trigger - if it evals true once per every ten calls to the trigger (say), you'd cut your de

Re: [SQL] Re: How to keep at-most N rows per group? periodic DELETEs or constraints or..?

2008-01-09 Thread Scott Marlowe
On Jan 9, 2008 12:20 PM, Steve Midgley <[EMAIL PROTECTED]> wrote: > This is kludgy but you would have some kind of random number test at > the start of the trigger - if it evals true once per every ten calls to > the trigger (say), you'd cut your delete statements execs by about 10x > and still per

[SQL] Re: How to keep at-most N rows per group? periodic DELETEs or constraints or..?

2008-01-09 Thread Steve Midgley
At 07:20 AM 1/9/2008, [EMAIL PROTECTED] wrote: Date: Tue, 8 Jan 2008 17:41:18 + From: "Jamie Tufnell" <[EMAIL PROTECTED]> To: pgsql-sql@postgresql.org Subject: Re: How to keep at-most N rows per group? periodic DELETEs or constraints or..? Message-ID: <[EMAIL PROTECTED]> On 1/8/08, codeWa