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!

URGENT HELP: How to show a record using NOT NULL?

Status
Not open for further replies.

sommererdbeere

Programmer
Nov 20, 2003
112
US
Hi,

my question here is i only show only a specific column from a specific value from oracle sql.. here is an example:

select work center, qty from work center
(if workcen = 'SU', then shows QTY != '0')

there are lot of workcen in my report, i wanna show everything, however, i only wanna show the data from column, QTY, where the data are not = '0'

please help please.. this is urgent.. thank u for all those who help.. thank u. thank u.. many many million thanks..

m
 
This select shows all work centers but only shows their quantity when workcenter code identifier is 'SU' and not equal '0'). I think it's what you need.

SELECT workcenter,DECODE(workcen,'SU',DECODE(qty,0,NULL,qty), NULL)
from workcenter

Regards.
Enrique.
 
May be simple Where clause can help you

select work center, qty from work center
where ( (workcen = 'SU'and QTY != '0') or (workcen <> 'SU'))

HTH..
Saket
 
I was not sure to have understood what sommererdbeere needed. For that, I wrote what my query solved.

The second query shows:
- all workcenters <> 'SU' with their QTY (zero or not)
and
- Only workcenters = 'SU' with QTY <> 0 (if = 0, workcenter will be rejected)

I'm not sure what he needs exactly but note that both queries don't say the same.

Regards,
Enrique.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top