dz's database dictionary pre_common_member_status user status table
- uid, mediumint, member id,
- regip, char, registered IP,
- lastip, char, last login IP,
- port, smallint, last login port number,
- lastvisit, int, last visited time,
- lastactivity, int, last activity,
- lastpost, int, last published,
- lastsendmail, int, the last email sent home original field is lastsend,
- invisible, tinyint, incognito login,
- buyercredit, smallint, buyer credit rating and points,
- sellercredit, smallint, seller credit score and points,
- favtimes, mediumint, personal space favorites,
- sharetimes, mediumint, personal space shares,
- profileprogress, tinyint, profile completion,
Let's check whether it is a "pre_common_member_status" table, as shown in the figure below:
The advantage of using timestamps to store time is that the query efficiency is high, the speed is fast, and the efficiency of querying data in a certain period of time is much higher with timestamps than with time
We query users who have not logged in after January 1, 2018, and the SQL statement is as follows:
After we know the UID of these users, we want to query the username and email address of the user, how should we query it? The user table of dz is stored in the "pre_ucenter_members" table, we need to join the table query, the sql is as follows:
|