Need help to get the right query to generate report [message #393256] |
Fri, 20 March 2009 19:28 |
appachan
Messages: 1 Registered: March 2009
|
Junior Member |
|
|
Hi,
I need help to write a query to get the following output.
The query result I am looking for is the number of defects submitted in a month and the number of defects closed in a month.
The database table contains the following data:
DefectId | SubmitDate | ClosedDate
1 | JAN | NULL
2 | JAN | JAN
3 | JAN | FEB
4 | JAN | APR
5 | FEB | APR
I need output in the following manner:
Month | Count(SubmitDate) | Count(ClosedDate)
JAN | 4 | 1
FEB | 1 | 1
MAR | 0 | 0
APR | 0 | 2
[Updated on: Fri, 20 March 2009 19:44] Report message to a moderator
|
|
|
|
Re: Need help to get the right query to generate report [message #393284 is a reply to message #393256] |
Sat, 21 March 2009 01:36 |
|
Michel Cadot
Messages: 68722 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Search for "row generator" and "calendar".
Post a Test case: create table and insert statements along with the result you want with these data.
Use SQL*Plus and copy and paste what you already tried.
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 (4 decimals).
Regards
Michel
|
|
|