Here's an SQL query that works fine in most database products, but  
PostgreSQL seems to choke on it:

select entity_type, entity_fk, count(*) as ent_count from  
assignment_rotation
group by entity_type, entity_fk
having ent_count > 1

        When I run this, I get an error:

ERROR: column "ent_count" does not exist
SQL state: 42703

        It seems that Postgres does not recognize column aliases. Since  
'having' applies to the result set, that alias should be present; in  
fact, I can order by that alias.

        Anyone know why this happens?

-- Ed Leafe





Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace. 
Any dissemination, distribution or copying of the enclosed material is 
prohibited.
If you receive this transmission in error, please notify us immediately by 
e-mail
at [EMAIL PROTECTED], and delete the original message. 
Your cooperation is appreciated.



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to