Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Content Management (Extended ECM)
API, SDK, REST and Web Services
Showing multiple columns with a count() function...
Herb_Schilling_(x-nasalewisuser4_-_(deleted))
How can I display more than one column with a count()/group by query? I want to do something like this -select daudit.dname, mycategorytbl.attribute1, count(*) from daudit, mycategorytbl where daudit.event = 'FETCH' and daudit.dataid in (select dataid from mycategorytbl where attribute1 like 'what%%' and attribute2 = 'somethingelse') and mycategorytbl.dataid = daudit.dataid group by daudit.dnamewhich should return -Dname Attribute1 count(*)doc1 whatever 50doc2 whatnot 128doc3 whatsoever 49This returns a message saying that it's an invalid group function.
Find more posts tagged with
Comments
John W. Simon, Jr.
Sean,You just have to make sure that every column except for the count(*) is included in the group by expression. In your example you only group by daudit.dname. You also need to group by mycategorytbl.attribute1 to make that statement work.Regards,JWS