i am trying to write a query but not reaching to the conclusion part. here is the req,,
i want all the distinct users who logged in 6 months ago and if a user who logged in 6 month before and again he looged in after 6 months( means if a user martin logs in 6 months ago and again logs in some time back may be 1 month back) then the user should not be selected as i want to delete those users who only looged in 6 months ago and not after that.
kindly help me in doing that.here is part of my query.
select DISTINCT username from arrfsysauditlog where (datelogged < CURRENT_TIMESTAMP - 180);