Tuesday 15 March 2011

mysql - Max records for a group of kiosks -


I am trying to get a list of the top ID records for each ID, but when I ask: / P>

  Maximum (submitted), T. ID id (262, 331, 144, 664, 353, 641, 190, 527, 581) ID id from Ods.events t;  

I get the following:

  + --------------------- + - ---- + --------------------- + | Max (submitted) | ID | Presented | + --------------------- + ----- + --------------------- + | 2015-03-17 14:39:53 | 144 | 2014-04-14 04:57:09 | | 2015-03-03 08:30:15 | 190 | 2014-04-14 01:51:01 | | 2015-03-17 13:40:14 | 262 | 2014-04-14 03:56:03 | | 2015-03-17 06:45:10 | 331 | 2014-04-14 05:51:02 | | 2015-03-17 14:39:41 | 353 | 2014-04-14 05:50:30 | | 2015-03-17 06:45:39 | 527 | 2014-04-13 21:38:14 | | 2015-03-17 15:41:32 | 581 | 2014-04-14 05:54:43 | | 2015-03-17 15:40:26 | 641 | 2014-04-14 05:52:10 | | 2015-03-17 15:42:10 | 664 | 2014-04-14 05:53:44 | + --------------------- + ----- + --------------------- +  

Apparently this is not bringing the full record associated with the maximum (submitted), but how do I record the entire record associated with the maximum (submitted) records?

Submitted selection, * events from where in the id ... by grouped id = group = Maximum (Deposit)


No comments:

Post a Comment