October 16, 2008 at 6:28 am
Hi,
I have a table called TEST, that contains 3 rows which are -
RowNo EmpNo Phonenumber
1 1 0199299123
2 1 0199299123
3 1 0199299124
4 1 0199299125
5 1 0199299123
6 1 0199299125
I want the result in -
EmpNo Phonenumber TotalCalled
1 0199299123 3
1 0199299124 1
1 0199299125 2
Anybody know how to write a query to come up like above.
Thanks.
October 16, 2008 at 6:33 am
Select
EmpNo,
PhoneNumber,
Count(RowNo) as total_calls
From
dbo.Test
Group By
EmpNo,
PhoneNumber
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
October 16, 2008 at 6:37 am
Hi Jack,
Thanks. What a good one.
Leo
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply