Reputation: 37
I need to get all the log in times of each users from our data store. fields of the data store are
users, logInTime, LogOutTime, ...
I know I can use count(logInTime)
and group it by users
to see how many times a user logged in to our system, but how can I get all the logged in times in a list?
Thank you guys!
Upvotes: 1
Views: 49
Reputation: 193
you can use the group_concat function so something like this:
select
userid, group_concat(logInTime,'|')
from table
group by userid
Upvotes: 1