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 --- _______________________________________________ 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/cajidmyknevbbwfw3r9shexa2-ug9nnhadj2gud3qmzvb33x...@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.

