Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
418 views
in Q2A Core by

I am working on re-implement last activity of user, my query return all activities created on specific user activites

but I want to return just one activity per each question which is the last

I don't know how select the last

I used group by , but it doesn't work correctly

Thanks for your help.

by
It is impossible to tell you how you should modify your not-working query without even seeing it
by
I found all other users activity on one user and now I want to sort the result
for example

I used (group by 'created') but i select first result of each parentid
Result:

postId   parentId     createdTime
-------------------------------------------------------------
1              1                  02/10/2015 13:52:56
4              1                  02/09/2015 18:36:35
6              4                  02/09/2015 23:13:05
7            10                  02/10/2015 12:45:34
8            10                  02/09/2015 17:46:15


Sorted Result:

postId   parentId     createdTime
-------------------------------------------------------------
1              1                  02/10/2015 13:52:56
7            10                  02/10/2015 12:45:34
6              4                  02/09/2015 23:13:05

Please log in or register to answer this question.

...