Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
ChetShah
Starting Member
37 Posts |
Posted - 2005-10-06 : 07:15:58
|
Hi,I'm not sure how to get this to work , i have a query that returns the following results:ClaimRef-----------ADKIN00010ADKIN00012ADKIN00014ADKIN00015ADKIN00016ADKIN00017ADKIN00018ADKIN00019ADKIN00020I want a write a count query which will return count of ADKIN = 9 ??Chet |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-06 : 07:19:46
|
Try thisSelect count(*) from yourTable where ClaimRef like 'ADKIN%'MadhivananFailing to plan is Planning to fail |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-10-06 : 07:20:19
|
One of these perhaps?SELECT LEFT(ClaimRef, 5), COUNT(*)FROM MyTableGROUP BY LEFT(ClaimRef, 5)orSELECT COUNT(*)FROM MyTableWHERE ClaimRef LIKE 'ADKIN[0-9][0-9][0-9][0-9][0-9]'Kristen |
|
|
ChetShah
Starting Member
37 Posts |
Posted - 2005-10-06 : 08:06:32
|
Thanks Kirstenyour queries work fineChet |
|
|
|
|
|