Click here to Skip to main content
15,900,378 members
Home / Discussions / Database
   

Database

 
GeneralRe: Select All Months and related data Pin
Mycroft Holmes9-Dec-12 19:15
professionalMycroft Holmes9-Dec-12 19:15 
GeneralRe: Select All Months and related data Pin
VishwaKL9-Dec-12 19:19
VishwaKL9-Dec-12 19:19 
GeneralRe: Select All Months and related data Pin
VishwaKL9-Dec-12 18:37
VishwaKL9-Dec-12 18:37 
GeneralRe: Select All Months and related data Pin
Deepak Kr110-Dec-12 19:27
Deepak Kr110-Dec-12 19:27 
GeneralRe: Select All Months and related data Pin
VishwaKL10-Dec-12 19:31
VishwaKL10-Dec-12 19:31 
GeneralRe: Select All Months and related data Pin
Deepak Kr110-Dec-12 21:02
Deepak Kr110-Dec-12 21:02 
GeneralRe: Select All Months and related data Pin
VishwaKL10-Dec-12 21:46
VishwaKL10-Dec-12 21:46 
GeneralRe: Select All Months and related data Pin
Deepak Kr110-Dec-12 22:25
Deepak Kr110-Dec-12 22:25 
Hey i just used the trunc method for oracle, u can replace to yr old year and month method to get the result, but the concept is that we will use the union clause to get the data for those month for which we dont have the data than we will do a union with yr old query then on the top of that put a sum for monthcount with group by month and year.

so yr query will be

SQL
select years, month, sum(MonthCount) from
 (
 SELECT  YEAR(RequestedDate) as Years, Month(RequestedDate) as MonthInNumbers,Count(Month(RequestedDate))
 FROM MYTABLE
 group by YEAR(RequestedDate),Month(RequestedDate)
  union
 select '2012' as years, 'JAN' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'FEB' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'MAR' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'APR' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'MAY' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'JUN' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'JULY' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'AUG' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'SEPT' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'OCT' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'NOV' as Month, 0 as MonthCount from dual
 union
 select '2012' as years, 'DEC' as Month, 0 as MonthCount from dual
 ) group by years, month

QuestionSSRS 2005 Pin
berba6-Dec-12 6:32
berba6-Dec-12 6:32 
AnswerRe: SSRS 2005 Pin
David Mujica6-Dec-12 7:59
David Mujica6-Dec-12 7:59 
AnswerRe: SSRS 2005 Pin
Corporal Agarn6-Dec-12 9:30
professionalCorporal Agarn6-Dec-12 9:30 
AnswerRe: SSRS 2005 Pin
Mycroft Holmes6-Dec-12 16:57
professionalMycroft Holmes6-Dec-12 16:57 
GeneralRe: SSRS 2005 Pin
berba6-Dec-12 18:06
berba6-Dec-12 18:06 
GeneralRe: SSRS 2005 Pin
Mycroft Holmes6-Dec-12 21:43
professionalMycroft Holmes6-Dec-12 21:43 
QuestionSQL Group By Question Pin
loyal ginger6-Dec-12 5:27
loyal ginger6-Dec-12 5:27 
AnswerRe: SQL Group By Question Pin
Blue_Boy6-Dec-12 10:11
Blue_Boy6-Dec-12 10:11 
GeneralRe: SQL Group By Question Pin
loyal ginger31-Dec-12 5:48
loyal ginger31-Dec-12 5:48 
QuestionIssues installing ODP.NETx64 Pin
cpp_prgmer6-Dec-12 4:18
cpp_prgmer6-Dec-12 4:18 
AnswerRe: Issues installing ODP.NETx64 Pin
Eddy Vluggen6-Dec-12 14:37
professionalEddy Vluggen6-Dec-12 14:37 
GeneralRe: Issues installing ODP.NETx64 Pin
Peter_in_27806-Dec-12 15:12
professionalPeter_in_27806-Dec-12 15:12 
GeneralRe: Issues installing ODP.NETx64 Pin
Mycroft Holmes6-Dec-12 16:52
professionalMycroft Holmes6-Dec-12 16:52 
AnswerRe: Issues installing ODP.NETx64 Pin
Mycroft Holmes6-Dec-12 16:53
professionalMycroft Holmes6-Dec-12 16:53 
QuestionSQL Query - append results Pin
AndreFratelli5-Dec-12 6:43
AndreFratelli5-Dec-12 6:43 
AnswerRe: SQL Query - append results Pin
Chris Meech5-Dec-12 6:55
Chris Meech5-Dec-12 6:55 
GeneralRe: SQL Query - append results Pin
AndreFratelli5-Dec-12 7:08
AndreFratelli5-Dec-12 7:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.