This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes diplayed the row number by action wise Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "diplayed the row number by action wise" Watch "diplayed the row number by action wise" New topic
Author

diplayed the row number by action wise

Geeta Ravikanti
Ranch Hand

Joined: Mar 26, 2008
Posts: 46
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 26496
    
  78

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: diplayed the row number by action wise
 
Similar Threads
javax.xml.ws.WebServiceException: Failed to access the WSDL
Project Euler problems with Scala
Whats wrong with system.err?
How to identify Auth method NTLMv1 or NTLMv2
Magic Square water retention