LucieLastic
Programmer
hi All
I thought this would be straight forward but can't get it to give me the right results. I have an extract of a simple table as follows
ID TypeID
1 2
1 2
1 3
1 2
2 1
2 1
2 1
I;d like the following results. It gives me a distinct count of the TypeIDs within each ID where there is >1 different TypeID, so it would look like this:
ID Count
1 2
I tried this query initially and lots of connotations of it but without success:
select ID, count(TypeID) from TypeList
group by ID, TypeID
having count(TypeID) > 1
order by ID
Where am I going wrong?
Thank you in advance for help.
Lou
I thought this would be straight forward but can't get it to give me the right results. I have an extract of a simple table as follows
ID TypeID
1 2
1 2
1 3
1 2
2 1
2 1
2 1
I;d like the following results. It gives me a distinct count of the TypeIDs within each ID where there is >1 different TypeID, so it would look like this:
ID Count
1 2
I tried this query initially and lots of connotations of it but without success:
select ID, count(TypeID) from TypeList
group by ID, TypeID
having count(TypeID) > 1
order by ID
Where am I going wrong?
Thank you in advance for help.
Lou