Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

diplayed the row number by action wise

 
Geeta Ravikanti
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My Input is


Time Action

17:30 Sell
17:35 Sell
17:40 Buy
17:45 Buy
17:50 Sell
17:55 Buy
18:00 Sell
18:05 Sell
18:10 Sell



I want out put like following


Time Action RowNumber

17:30 Sell 1
17:35 Sell 2
17:40 Buy 1
17:45 Buy 2
17:50 Sell 1
17:55 Buy 1
18:00 Sell 1
18:05 Sell 2
18:10 Sell 3


my problem is i am getting the rownumbers 1,2,3,4,5,like so on
but how to get the row numbers like 'sell' and 'buy' wise(like aboe out put)
any one help in this query'
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Geeta,
The easiest way is to do it in Java after the JDBC result is returned. If you need to do this in standalone SQL, the answer is database specific - if possible at all. What database are you using if you can't use JDBC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic