I have a table :
ID = autonumber
username
pcname
logoncount
username + pcname together are unique
but one username can appear several times with various PCnames, and a pc name can appear several times with differenty users and each has a different id number
I want to display every user only once with the Pc if which maxcount is the highest value
ie.
id = 1 username is prinand, pcname = x logoncount = 5
id = 2 username is prinand, pcname = y logoncount = 3
id = 3 username is xx, pcname = ww logoncount = 3
id = 4 username is xx, pcname = uu logoncount = 7
the output should be
id username pcname logoncount:
1 prinand x 5
4 xx uu 7
what works is :
Select username,max(logoncount) from table group by username
but now I still don't know my id and pcname and if I add id, I get an error again
can someone suggest a proper select command ?
ID = autonumber
username
pcname
logoncount
username + pcname together are unique
but one username can appear several times with various PCnames, and a pc name can appear several times with differenty users and each has a different id number
I want to display every user only once with the Pc if which maxcount is the highest value
ie.
id = 1 username is prinand, pcname = x logoncount = 5
id = 2 username is prinand, pcname = y logoncount = 3
id = 3 username is xx, pcname = ww logoncount = 3
id = 4 username is xx, pcname = uu logoncount = 7
the output should be
id username pcname logoncount:
1 prinand x 5
4 xx uu 7
what works is :
Select username,max(logoncount) from table group by username
but now I still don't know my id and pcname and if I add id, I get an error again
can someone suggest a proper select command ?