i have a table with fields name, time, and userid. I want to select name and time, such that no name is duplicated i.e. no same names should be returned and the result should be sorted by time(DESC). I cant make a query for this. Can someone help.
I tried this query but it doesnt work::
but it gives error.
Thanx.
I tried this query but it doesnt work::
Code:
SELECT DISTINCT(name), time FROM [i]table_name[/i] WHERE visitorid='1' ORDER BY time DESC;
Thanx.