Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use mysql to calculate the maximum unlogged-in period for users this year

Shulou Source: shulou.com Published: 2022-05-31 15:55:15 10月03日 Update

Editor to share with you how to use mysql to calculate the maximum unlogged-in period of users this year, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's learn about it!

Calculate the maximum period during which users are not logged in this year

Space_user_task_statistics_log if the user has logged in, the information is recorded in the table

The main information includes user ID and login time.

Space_user records the basic information of users. It mainly includes user ID and registration time information.

Demand:

Check the largest unlogged-in period for all users in 2017

If the user registers only in 2017, the valid time starts from the registration time.

In fact, this is a problem of MySQL computing continuous range.

SQL

Tags: Time user login maximum time period information article content valid not so most days more knowledge scope industry information information channel this is the question Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL OPPO Reno macOS Huawei Microsoft