If you could post some fake data to http://sqlfiddle.com/, and let us know
what you want the results to look like, that might help.

On Thu, Jan 29, 2015 at 3:31 PM, Stephen Russell <[email protected]>
wrote:

> On Thu, Jan 29, 2015 at 2:22 PM, Jeff Johnson <[email protected]> wrote:
>
> > Let's assume I have a select statement:
> >
> > SELECT cname, ccity, cnumber sum(1) as groupcount from mytable group by
> > cname, ccity, cnumber orger by cname
> >
> > I have to put all of the fields in the group by but the sum will give me
> > each individual cname, ccity, cnumber which is not what I want.
> >
> > How do I get just the number of cnames?
> > -----------
>
>
> Do you want a count of rows by name, city?
>
> select  cname, ccity, count(*) as groupcount from mytable group by cname,
> ccity
>
>
>
>
> --
> Stephen Russell
> Sr. Analyst
> Ring Container Technology
> Oakland TN
>
> 901.246-0159 cell
>
>
> --- StripMime Report -- processed MIME parts ---
> multipart/alternative
>   text/plain (text body -- kept)
>   text/html
> ---
>
[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/cagd8mrftnnwohudhu4e53l_bmzc2xvgqlbgahqj1gw2u+0e...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to