Hello friends,
I have table containing data as follows
Id Date Comment fromId toId
1 1/11/2011 7:06:16 PM Test1 2 8
2 1/11/2011 7:06:16 PM Test1 2 8
3 1/11/2011 7:06:16 PM Test1 2 8
4 1/11/2011 7:06:16 PM Test1 2 8
5 1/11/2011 7:06:16 PM Test1 2 8
6 01/13/2011 9:10:16 PM Test2 5 8
7 01/13/2011 9:10:16 PM Test2 5 8
8 01/13/2011 9:10:16 PM Test2 5 8
9 01/13/2011 9:10:16 PM Test2 5 8
10 01/14/2011 11:10:16 PM Test3 6 9
Now i want to show the record as following for toId=8
Date comment fromId toId
01/12/2011 7:06:16 PM Test1 2 8
01/13/2011 9:10:16 PM Test2 5 8
What should be the select query for this please help