Home » SQL & PL/SQL » SQL & PL/SQL » total rowcount group by second (Oracle 9i , Linux)
total rowcount group by second [message #428338] Wed, 28 October 2009 00:22 Go to next message
optimus
Messages: 4
Registered: August 2009
Junior Member
Dear All,
I need a hint for the below output
table data like
txn_date, success_fail, amount
01-JUN-09 08:01, success, 1000
01-JUN-09 08:03, success, 1000
01-JUN-09 08:05, success, 1000
01-JUN-09 08:05, success, 2000
01-JUN-09 09:01, success, 1000
01-JUN-09 09:09, success, 1000
01-JUN-09 09:11, fail, 1000
02-JUN-09 08:01, success, 2000
02-JUN-09 08:03, success, 1000
02-JUN-09 08:05, success, 3000
02-JUN-09 09:01, success, 1000
02-JUN-09 09:09, success, 2000
02-JUN-09 09:11, success, 1000

suppose i need the maximum txn hour of 01-JUN-09 and total second wise transaction count of that hour.

the output should be
time, total_txn
08:01, 1
08:03, 1
08:05, 2

some thing like this. How can I start. Any hint?
Re: total rowcount group by second [message #428345 is a reply to message #428338] Wed, 28 October 2009 00:45 Go to previous messageGo to next message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
Not sure exactly what you are asking, but it seems to me your are trying to construct aggregate data. If so there are two way:

1) use a group by
2) use analytics

Each is well described on the web and a google or two will lead you to the details.

Good luck, Kevin
Re: total rowcount group by second [message #428356 is a reply to message #428338] Wed, 28 October 2009 01:50 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Post a working Test case: create table and insert statements along with the result you want with these data.

Before please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code (See SQL Formatter), use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

Regards
Michel
Previous Topic: Query Rewrite Not selected
Next Topic: Read write access
Goto Forum:
  


Current Time: Sun Dec 04 04:17:37 CST 2016

Total time taken to generate the page: 0.11497 seconds