dbTalk Databases Forums  

Question about DECODE

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Question about DECODE in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Mtek
 
Posts: n/a

Default Question about DECODE - 08-22-2008 , 12:40 PM







Hi,

I have a question about DECODE. I know that I can return a 1 or 0
using DECODE:

SELECT (DECODE...,1,0) FROM <table name> WHERE........;

My question is, what you need to just decode the result of the where?
Basically if all the criteria of the WHERE statement is true, return a
1, and if any of the criteria is false, return a 0.

SELECT (DECODE...,1,0) FROM <table name> WHERE........
AND.......AND......;

Is there a way to do that?? Subqueries? Analytical functions??


Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Question about DECODE - 08-22-2008 , 11:09 PM






Mtek wrote:
Quote:
Hi,

I have a question about DECODE. I know that I can return a 1 or 0
using DECODE:

SELECT (DECODE...,1,0) FROM <table name> WHERE........;

My question is, what you need to just decode the result of the where?
Basically if all the criteria of the WHERE statement is true, return a
1, and if any of the criteria is false, return a 0.

SELECT (DECODE...,1,0) FROM <table name> WHERE........
AND.......AND......;

Is there a way to do that?? Subqueries? Analytical functions??
*** Duplicate Post ***

Please post only one message in one group. Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #3  
Old   
DA Morgan
 
Posts: n/a

Default Re: Question about DECODE - 08-22-2008 , 11:09 PM



Mtek wrote:
Quote:
Hi,

I have a question about DECODE. I know that I can return a 1 or 0
using DECODE:

SELECT (DECODE...,1,0) FROM <table name> WHERE........;

My question is, what you need to just decode the result of the where?
Basically if all the criteria of the WHERE statement is true, return a
1, and if any of the criteria is false, return a 0.

SELECT (DECODE...,1,0) FROM <table name> WHERE........
AND.......AND......;

Is there a way to do that?? Subqueries? Analytical functions??
*** Duplicate Post ***

Please post only one message in one group. Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #4  
Old   
DA Morgan
 
Posts: n/a

Default Re: Question about DECODE - 08-22-2008 , 11:09 PM



Mtek wrote:
Quote:
Hi,

I have a question about DECODE. I know that I can return a 1 or 0
using DECODE:

SELECT (DECODE...,1,0) FROM <table name> WHERE........;

My question is, what you need to just decode the result of the where?
Basically if all the criteria of the WHERE statement is true, return a
1, and if any of the criteria is false, return a 0.

SELECT (DECODE...,1,0) FROM <table name> WHERE........
AND.......AND......;

Is there a way to do that?? Subqueries? Analytical functions??
*** Duplicate Post ***

Please post only one message in one group. Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


Reply With Quote
  #5  
Old   
DA Morgan
 
Posts: n/a

Default Re: Question about DECODE - 08-22-2008 , 11:09 PM



Mtek wrote:
Quote:
Hi,

I have a question about DECODE. I know that I can return a 1 or 0
using DECODE:

SELECT (DECODE...,1,0) FROM <table name> WHERE........;

My question is, what you need to just decode the result of the where?
Basically if all the criteria of the WHERE statement is true, return a
1, and if any of the criteria is false, return a 0.

SELECT (DECODE...,1,0) FROM <table name> WHERE........
AND.......AND......;

Is there a way to do that?? Subqueries? Analytical functions??
*** Duplicate Post ***

Please post only one message in one group. Thank you.
--
Daniel A. Morgan
Oracle Ace Director & Instructor
University of Washington
damorgan@x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org


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.