i have a table like this:
user | session
test1 | 11
test1 | 11
test1 | 11
test1 | 21
test1 | 21
test2 | 2
test2 | 2
test3 | 3
test3 | 3
test3 | 32
test3 | 32
i would like to get back that user 1 has 2 sessions, user 2 has 1 sessions, user 3 has 2 sessions
bassically how many the same sessions a user has?
i've tryed $sql4 = SELECT user, session , count(*) FROMtablegroup by user, session
and i get the distinct sessions but not the count
any ideas? thanks
edit:
if i use SELECT user, count(*) FROM users GROUP BY user i get test 1 = 5. it give's me the total nr or sessions instead of total nr of sessions that are the same. in this case 2