MYSQL last login and number of logins in last 3 months

后端 未结 3 1546
臣服心动
臣服心动 2021-01-14 14:02

I\'m trying to write a query to join a user table to an activity logging table and return the following for each user:

A) The time they last logged in.

B)

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-14 14:23

    Just as one more crazy idea - instead of MAX( TIME )

    coalesce(max(time), (select max(time) from UserWebActivity where ...) )
    

提交回复
热议问题