Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Statement: Count IDs in a Specific Term if ID doesn't Exist in Previous Terms

Status
Not open for further replies.

kernal

Technical User
Feb 27, 2001
415
US
Quick sample of table

Person
ID Term
1 1078
1 1082

2 1026
2 1088

3 1078

4 1122
4 1138

I want to count an ID if their first term ends in 8 and don't count them if their first term doesn't end in 8 so results:

Term Count ID
1078 2 (ID 1 and 3)
1088 0 (since ID 2 has their first term ending with 6 they are not included)
1138 0 (since ID 4 has their first term ending with 2 they are not included)

Help is appreciated. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top