R
Rick A
I have a table that contains data similar to this
ID | EventDateID
12 100
12 110
12 120
13 110
13 120
13 130
14 110
....
Both fields make up the primary key and are both foreign keys.
I need to two counts
1) The number of times the ID shows up the first time
2) The number of times the ID shows up every time there after
For example: First time ID count would be equal to 3 - 12, 13, 14 (does
not matter what the EventDateID is)
"Second or more time" the ID count would be 4 too - 12, 12, 13, 13
I can count distinct to get the first time but the second or more time is
where's I'm struggling. Any thoughts would be greatly appreciated.
Thanks,
Rick
ID | EventDateID
12 100
12 110
12 120
13 110
13 120
13 130
14 110
....
Both fields make up the primary key and are both foreign keys.
I need to two counts
1) The number of times the ID shows up the first time
2) The number of times the ID shows up every time there after
For example: First time ID count would be equal to 3 - 12, 13, 14 (does
not matter what the EventDateID is)
"Second or more time" the ID count would be 4 too - 12, 12, 13, 13
I can count distinct to get the first time but the second or more time is
where's I'm struggling. Any thoughts would be greatly appreciated.
Thanks,
Rick