December 29, 2014 at 6:39 am
hi,
my data is like this.
code-----name
ACT------199
CDF------198
DNC------199
FAI-------197
FNC------198
ACT--------1
CDF--------2
DNC--------1
FAI---------3
FNC--------2
i want data like this
code-----name-----count
ACT------199------1
CDF------198------2
DNC------199-----1
FAI-------197-----3
FNC------198-----2
this is my query
Select
LEFT(a.evs_Code,3) as CODE, COUNT(*) as Name
From evs_ccagentcodes a
where a.evs_ContactCenterName like '%CCH'
Group by LEFT(a.evs_Code,3),a.evs_CodeUsed
please help me out
thanks for the help.
immad
December 29, 2014 at 6:47 am
What are the values for a.evs_CodeUsed in the table?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
December 29, 2014 at 6:49 am
sorry
code-----name-----a.evs_CodeUsed
ACT------199------------1
CDF------198------------2
DNC------199------------1
FAI-------197------------3
FNC------198------------2
thanks 4 the help.
immad
December 29, 2014 at 6:52 am
Err, what????
That now doesn't match the query you posted (which returns only two columns) and is the result that you're asking for. If you already have that result, why are you asking for help in getting it?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply