I have a table similar to this
Table(Id int, PropertyId int, UserId int, AccesedOn datetime)
So the table can have value for one property for one user, but different times.
Eg.
1,100,5, 2012-10-16 16:24:48
2,100,5, 2012-10-17 11:22:00
3,100,5, 2012-10-18 17:10:05
What I am trying here is to select distinct properties for specific user, but order by most recent access time.
Also I am joining this table to three other tables which result in providing duplicate values. Therefore I have to use DISTINCT command.
Problem I have is since I doing the orderby AccesedOn, it need to appear on select statement which doesn’t brings the distinct values since the AccesedOn column have different values.
For above example it should return only 3,100,5, 2012-10-18 17:10:05
Any suggestions to overcome this?
1 Answer