I am using VFP 6.0 and I am trying to put together a simple SQL statement that will count how many occurences of each distinct record I have in my database. Here is a sample of my data:
First Last City State Zip
John Adams Midland Texas 79703
John Adams Midland Texas 79707
John Smith Midland Texas 79703
John Smith Midland Texas 79703
John Smith Midland Texas 79703
John Smith Angelo Texas 76901
Sally Barnes Odessa Texas 79769
Sally Barnes Odessa Texas 79769
I want to select distinct for First+Last+City+State+Zip and then count how many records in my database have that distinct entry. So I want my output to look something like this:
First Last City State Zip Count
John Adams Midland Texas 79703 1
John Adams Midland Texas 79707 1
John Smith Midland Texas 79703 3
John Smith Angelo Texas 76901 1
Sally Barnes Odessa Texas 79769 2
Any help would be appreciated, thanks!
First Last City State Zip
John Adams Midland Texas 79703
John Adams Midland Texas 79707
John Smith Midland Texas 79703
John Smith Midland Texas 79703
John Smith Midland Texas 79703
John Smith Angelo Texas 76901
Sally Barnes Odessa Texas 79769
Sally Barnes Odessa Texas 79769
I want to select distinct for First+Last+City+State+Zip and then count how many records in my database have that distinct entry. So I want my output to look something like this:
First Last City State Zip Count
John Adams Midland Texas 79703 1
John Adams Midland Texas 79707 1
John Smith Midland Texas 79703 3
John Smith Angelo Texas 76901 1
Sally Barnes Odessa Texas 79769 2
Any help would be appreciated, thanks!