I was looking for a SQL commands like this
my problem is that I have a table, from witch I wish to have all distinct "user_ip", but togeter with the users_ip, I would also like to have the time (not distinct)
so a SQL like
SELECT DISTINCT user_ip,time FROM table
would give me a result where all distinct user_ip AND distinct time is in.
witch mean I will also get thise 2
ip | time |
-----------------------|
12.34.56.78 | 12:00 |
12.34.56.78 | 14:00 |
.
.
I only wan the DISTINCT to work on the first row (user_ip), and it should be the last one of them (14:00)
I guess something like this, but it does not work...
SELECT DISTINCT (user_ip) time FROM table ORDER BY time
how do I do that - anyone knows ?