Re: [HACKERS] aliases, &c in HAVING clause?

2004-06-07 Thread Tom Lane
[EMAIL PROTECTED] (David Fetter) writes: > I bumped across this several times, and am wondering what SQL99 and > SQL200x have to say about column numbers or aliases in HAVING. SQL99 not only does not allow them in GROUP BY or HAVING, but it doesn't allow them in ORDER BY either, thereby eliminatin

Re: [HACKERS] aliases, &c in HAVING clause?

2004-02-23 Thread Tom Lane
David Fetter <[EMAIL PROTECTED]> writes: > Just in general, isn't it better to write a piece of code (here, a > possibly-complicated aggregate) just once and refer to it elsewhere > rather than have to write a separate copy of it everywhere it's used? In general, you do that with subselects. Havi

Re: [HACKERS] aliases, &c in HAVING clause?

2004-02-23 Thread David Fetter
On Mon, Feb 23, 2004 at 06:36:48PM -0500, Tom Lane wrote: > [EMAIL PROTECTED] (David Fetter) writes: > > I bumped across this several times, and am wondering what SQL99 > > and SQL200x have to say about column numbers or aliases in HAVING. > > SQL99 not only does not allow them in GROUP BY or HAVI

[HACKERS] aliases, &c in HAVING clause?

2004-02-23 Thread David Fetter
Kind people, I bumped across this several times, and am wondering what SQL99 and SQL200x have to say about column numbers or aliases in HAVING. SQL92 is fairly clear (no) but also somewhat out of date. Here's a scenario: SELECT foo_name, count(*) as foo_count FROM foo GROUP BY foo_name HAVING fo

Re: [HACKERS] aliases

2003-07-06 Thread Alvaro Herrera
On Sun, Jul 06, 2003 at 10:15:37PM +0200, ivan wrote: > > where can i find aliases to type , for example INT4 = INT = INTEGER ... > I realy need it to check if function is exists .. > Or how to get oid from same type , but no like select from pg_type Maybe this is helpful: alvh=> select 'int'::r

[HACKERS] aliases

2003-07-06 Thread ivan
where can i find aliases to type , for example INT4 = INT = INTEGER ... I realy need it to check if function is exists .. Or how to get oid from same type , but no like select from pg_type now about plpgsql i think that will be nice , to possible declare var. with names started from $ (like funct