SELECT DISTINCT ul.users_userid, ul.userlogins_time FROM userlogins ul ORDER BY ul.userlogins_time
My table consists of the two above column, users_userid holding a userid ofcourse and userlogins_time holding a unix timestamp.
There will be multiple records that have the same userid in them but I only want the one with the highest or lowest userlogins_time (sort order doesn´t matter at this point).
Distinct has always worked perfect with this before for me but now all of a sudden it´s not. Can anyone tell me what´s wrong ?