dbTalk Databases Forums  

displaying a column in report which returns null value

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss displaying a column in report which returns null value in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dtrusha@gmail.com
 
Posts: n/a

Default displaying a column in report which returns null value - 03-09-2007 , 12:02 AM






Hi
I have a simple report with two column. The query is as below.
SELECT decode(caste,1,'SC/ST',2,'General','3','PWD') fcastepi,
nvl(count(*),0) fcapi
FROM applicationformdtl
WHERE year = _year
AND selected = 1
AND PROGCD = 'PRM'
GROUP BY caste

This query returns values for SC/ST and General as there is no
matching data for the PWD. But I want to display PWD with value 0 in
the report. How to do this? Can anyone help me in this matter at the
earliest?

The required output is
SC/ST 100
General 300
PWD 0

Regards
Trusha


Reply With Quote
  #2  
Old   
Michel Cadot
 
Posts: n/a

Default Re: displaying a column in report which returns null value - 03-09-2007 , 09:58 AM







<dtrusha (AT) gmail (DOT) com> a écrit dans le message de news: 1173420147.016604.284770 (AT) p10g20...oglegroups.com...
Quote:
Hi
I have a simple report with two column. The query is as below.
SELECT decode(caste,1,'SC/ST',2,'General','3','PWD') fcastepi,
nvl(count(*),0) fcapi
FROM applicationformdtl
WHERE year = _year
AND selected = 1
AND PROGCD = 'PRM'
GROUP BY caste

This query returns values for SC/ST and General as there is no
matching data for the PWD. But I want to display PWD with value 0 in
the report. How to do this? Can anyone help me in this matter at the
earliest?

The required output is
SC/ST 100
General 300
PWD 0

Regards
Trusha

Something like:

SELECT decode(b.caste,1,'SC/ST',2,'General','3','PWD') fcastepi,
nvl(count(a.caste),0) fcapi
FROM applicationformdtl a
, ( select rownum caste from dual connect by level <= 3 ) b
WHERE year (+) = _year
AND selected (+) = 1
AND PROGCD (+) = 'PRM'
and a.caste (+) = b.caste
GROUP BY b.caste
/

Regards
Michel Cadot




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.