Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do in oracle reports.

Status
Not open for further replies.

garry1

Programmer
Dec 6, 2002
49
US
Hi,

I am trying to create a blank reecord if the values in the column doesn't match, but I am running into some problems.

For example I have the following values

ID, BLDG, WBLDG
323,NV HOMES,NV HOMES -- OK
323,NV HOMES,NV HOMES11-- Not OK. User wants something like
323,NV HOMES
323 NV HOMES11

I am using the following query.

select distinct id,
BCN as bldg,
(select VALUE from WR_A where WR_A_CODE = 'CONFIG NAME' and wr_no = c.wr_no) as WBLDG
From WRc,
BCA d,
BWR e,
BBC g
where c.wr_no = e.wr_no and
g.bca_id = e.bca_id and
d.id = e.bca_id and
e.bca_id = 323
group by BCN, id, c.wr_no

Any help is very much appreciated on this.

Thanks.
 
Could you please explain what is that that user doesn't like and what he likes instead?
 
Nagornyi,

Thanks for your kind reply. This is what user wants to see in the report. If BLDG and WBLDG are matching then he wants me to display as a single record like below.
ID, BLDG, WBLDG
323, NV HOMES NV HOMES

If BLDG and WBLDG are not matching like the below eample

ID, BLDG, WBLDG
323, NV HOMES NV HOMES11

User wants to see something like this
ID, BLDG, WBLDG
323, NV HOMES --
323 --- NV HOMES11

Any help is appreciated.

Thanks.
 
You may try this approach:
Code:
select distinct from
(
(
select
  ID
, decode(BLDG, WBLDG, BLDG, '---') bldg
, decode(BLDG, WBLDG, BLDG, WBLDG) wbldg
.......
)
union
(
select
  ID
, decode(BLDG, WBLDG, BLDG, BLDG) bldg
, decode(BLDG, WBLDG, BLDG, '---') wbldg
.......
)
)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top