Link to home
Start Free TrialLog in
Avatar of goodk
goodkFlag for United States of America

asked on

select (count(job) + job) from AceData group by job ??

select (count(job) + job)  from AceData  group by job

using ms sql server

the above not working

want to show,

25 myJob
30 otherjob
01 badjob
SOLUTION
Avatar of Pratima
Pratima
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of goodk

ASKER

I've requested that this question be deleted for the following reason:

resolved used str() to convert
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of goodk

ASKER

I tried this, should this be ok?  The results looks fine
Select (type +' ('+ ltrim(str(count(type))) +')' ) as xtest from AceData group by type
Avatar of goodk

ASKER

thanks
Yes that will work but why use to functions when you can get away with one

In programming trick is to make things simple not complicated

Select (type +' ('+ convert(varchar,count(type)) +')' )

Open in new window

Avatar of goodk

ASKER

thanks