HI, I have a table where user logins are registered
Table is called g2_UserinfoMap and it looks like this:
g_id | g_userId | g_userName | g_ipAddress | g_timeStamp | g_action
Records in table are added after each user login to the site:
Quote:
10 | 100 | user2 | 86.4.44.7 | 1256330245 | Login
10 | 100 | user1 | 86.5.44.8 | 1256330309 | Login
10 | 100 | user2 | 86.4.44.7 | 1256330317 | Login
10 | 100 | user2 | 86.4.44.7 | 1256331833 | Login
10 | 100 | mano3 | 86.55.2.45 | 1256331859 | Login
10 | 100 | user99 | 86.100.10.10 | 1256331864 | Login
|
I'm trying to make a a select query to show users that were not logged in the last 3 months to the site so I could delete them from site management interface.
I tried this SQL:
Code:
SELECT *
FROM g2_UserinfoMap
WHERE g_timeStamp <= UNIX_TIMESTAMP( '2010-02-01 00:00:00' ) && g_userName != 'admin' && g_action = 'Login'
This gives me users that are not admin, but it lists all users.
I think I need something like NOT BETWEEN but how to do it with Unixtime (g_timeStamp) field is in unixtime.
I tried to make like this but get an error obviously:
Code:
SELECT DISTINCT *
FROM g2_UserinfoMap
WHERE g_timeStamp NOT BETWEEN UNIX_TIMESTAMP( '2010-02-01 00:00:00' && '2010-01-01 00:00:00')