Re: displaying a column in report which returns null value

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Fri, 9 Mar 2007 16:58:48 +0100
Message-ID: <45f18437$0$2146$426a74cc_at_news.free.fr>


<dtrusha_at_gmail.com> a écrit dans le message de news: 1173420147.016604.284770_at_p10g2000cwp.googlegroups.com...
| 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 = :p_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 (+) = :p_year

      AND selected (+) = 1
     AND PROGCD (+) = 'PRM'

and a.caste (+) = b.caste
 GROUP BY b.caste
/

Regards
Michel Cadot Received on Fri Mar 09 2007 - 16:58:48 CET

Original text of this message