Re: Simple (hopefully) query question

From: <fitzjarrell_at_cox.net>
Date: Fri, 8 Feb 2008 07:04:25 -0800 (PST)
Message-ID: <1760fa08-6a51-467a-92a4-22c0781cc513@s37g2000prg.googlegroups.com>


On Feb 7, 3:14 pm, "shakespeare" <what..._at_xs4all.nl> wrote:
> <fitzjarr..._at_cox.net> schreef in berichtnews:46eaf728-d37c-4b8c-934f-662495d16fed_at_e23g2000prf.googlegroups.com...
> On Feb 6, 2:22 pm, TonyV <kingskip..._at_gmail.com> wrote:
>
>
>
>
>
> > Hey all, I'm having a problem with what should be a simple query. I
> > don't know if my brain is fried today or what, but hopefully the
> > following simple example will explain what I'm trying to do:
>
> > -- Does NOT work
> > select col_name, col_count
> > from (
> > select column1 "col_name", count(column1) "col_count"
> > from table_name
> > group by column1
> > )
> > where col_count > 1;
>
> > When I try to run this, I get dinged with a 904 error, invalid
> > identifier.
>
> > My question is this: How can I select the name and count of something
> > where the count is greater than one?
>
> Use group by and having:
>
> select column1 "col_name", count(column1) "col_count"
> from table_name
> group by column1
> having count(column1) > 1;
>
> David Fitzjarrell
>
> -----------------------------------
> Works too, even better.....
> The cause of the error however were the quotes....
>
> Shakespeare- Hide quoted text -
>
> - Show quoted text -

I understand that, but the question, clearly presented at the end of the post:

"My question is this: How can I select the name and count of something where the count is greater than one?"

Which I answered.

David Fitzjarrell Received on Fri Feb 08 2008 - 09:04:25 CST

Original text of this message