用户情况
-
SQL基础:SQL 如何查询连续登录的用户情况
要查询连续登录的用户情况,可以使用以下SQL语句:,,``sql,SELECT user_id, MIN(login_time) AS start_time, MAX(login_time) AS end_time,FROM login_records,GROUP BY user_id,HAVING COUNT(*) ˃ 1;,``
要查询连续登录的用户情况,可以使用以下SQL语句:,,``sql,SELECT user_id, MIN(login_time) AS start_time, MAX(login_time) AS end_time,FROM login_records,GROUP BY user_id,HAVING COUNT(*) ˃ 1;,``