December 30, 2014 at 2:22 am
hi,
i have a problem.my data is like that
CODE------Name
ACT----------1
ACT----------1
ACT----------1
ACT----------1
i want data like this.
CODE------Name
ACT----------4
please help me out
thanks for the help
immad
December 30, 2014 at 2:29 am
The same way as in this thread of yours http://www.sqlservercentral.com/Forums/Topic1646925-149-1.aspx, you can just omit the LEFT function since you're grouping by the entire column
Please don't post multiple threads for the same problem.
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 30, 2014 at 2:31 am
SELECT CODE, COUNT(Name) AS Name
FROM TABLENAME
GROUP BY CODE
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply