Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2009-12-30 : 07:58:34
|
| I have a table appeals with userid,outcome,mydatetimenow I want to show a list ordered by mydatetime desc of all userid and the number of records for that user id - and the last mydatetime for that userid.)can you help me?(I need a list of all users adn how many records - but with the datetime of the last record) |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-12-30 : 08:09:30
|
selectuserid,count(*) as num_of_records,max(mydatetime) as mydatetimefrom appealsgroup by useridorder by mydatetime desc No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2009-12-30 : 08:23:00
|
| thanks :) |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-12-30 : 09:07:49
|
welcome  No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|