0

私はそのテーブルを持っています:

フォーラム:

 _____________________________________________________________
|match_static_id| comment   | timpstamp            | user_id  |
|_______________|___________|______________________|__________|
|  1            |  Hi       | 2013-07-10 12:15:03  |     2    |
|  1            |  Hello    | 2013-07-09 12:14:44  |     1    | 
|_______________|___________|______________________|__________|

作業クエリは次のとおりです。

select forum.match_static_id, 
       count(forum.match_static_id) 'comment_no' 
Group By forum.match_static_id 

しかし、私がしたい場合はどうなりますか:

select forum.match_static_id, 
   count(forum.match_static_id) 'comment_no',
   forum.timestamp
Group By forum.match_static_id 

前のクエリと同じ結果が得られますが、各レコードのタイムスタンプの値があります

この値を最新のタイムスタンプにしたいのですが、それは可能ですか?

4

2 に答える 2

0

How about this:

select forum.match_static_id, 
count(forum.match_static_id) 'comment_no',
max(forum.timestamp)
Group By forum.match_static_id
于 2013-07-10T11:52:33.720 に答える