Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

display value based on condition

4607Dec 13 2012 — edited Dec 13 2012
Hi all,

Not sure if my Subject is the most descriptive, but not sure how to explain in a sentence.

I have wells that can have multiple statuses (one record for each status). I need to create a column to display a Y or N based on whether or not a given well has only certain types statuses. If all records for a given well are Susp and/or Abd, then I want to display a Y. If the well records include Susp or Abd, but also have other statuses (or do not even have a status of susp or abd) then I want to display a N.

So:
Well           Status       ident
12345         SUSP          Y
12345         SUSP          Y
12345         ABD           Y
98765         SUSP          N
98765         PROD         N
98765         ABD           N 
45678         SUSP          Y
45678         SUSP          Y
ASDFG         ABD           Y
ASDEG         ABD           Y
TTTTT         PROD       N
TTTTT         TEMP       N
Any thoughts?

Edited by: dgouin on Dec 13, 2012 6:59 AM
This post has been answered by Frank Kulash on Dec 13 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 10 2013
Added on Dec 13 2012
4 comments
4,634 views