Need to disable user who have not logged in for past 2 years in jira. Please help. I need select query for this.
I used various query but I was not getting this select query result correctly.
Thanks in advance.
Hi,
with MySQL you can use:
SELECT cwd_user.display_name as Name,cwd_user.user_name as Username, FROM_UNIXTIME(cwd_user_attributes.attribute_value/1000) AS "Last Logged in on"FROM cwd_user, cwd_user_attributesWHERE cwd_user.id = cwd_user_attributes.user_id AND cwd_user_attributes.attribute_name = 'login.lastLoginMillis'AND FROM_UNIXTIME(cwd_user_attributes.attribute_value/1000) < "2018-02-18 00:00:00.000000"ORDER BY cwd_user_attributes.attribute_value DESC
Not sure about other SQL dialects. You should consult the specific database documentation on converting cwd_user_attributes.attribute_value to a comparable timestamp.
Best
JP
It looks like you're new here. Sign in or register to get started.