Skip navigation links

MySQL Forums :: Cursors :: Subselect and walking throught result with cursor


Advanced Search

Re: Subselect and walking throught result with cursor
Posted by: Devart Team ()
Date: September 14, 2010 01:13AM

There are variants; try this one -

SELECT r1.* FROM robots r1
  JOIN (SELECT IDaukce, MIN(counter) max_counter FROM robots r2 GROUP BY IDaukce) r2
    ON r1.IDaukce = r2.IDaukce AND r1.counter = r2.max_counter;

+----+---------+-------+---------+
| ID | IDaukce | uziv  | counter |
+----+---------+-------+---------+
|  2 |       1 | Chuck |       0 |
|  3 |       2 | Chuck |       0 |
+----+---------+-------+---------+

Devart Company,
MySQL management tools
http://www.devart.com/dbforge/mysql/

Options: ReplyQuote


Subject Views Written By Posted
Subselect and walking throught result with cursor 3107 Jan Jůna 09/13/2010 01:17PM
Re: Subselect and walking throught result with cursor 1090 Devart Team 09/14/2010 01:13AM
Re: Subselect and walking throught result with cursor 1074 Jan Jůna 09/15/2010 04:42AM
Re: Subselect and walking throught result with cursor 1257 Devart Team 09/16/2010 01:27AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.