Re: conditional selection of 'AND' or 'Select' in Oracle

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 16 Apr 2004 21:57:27 -0400
Message-ID: <a5WdnStVHuuCEh3dRVn-gg_at_comcast.com>


"Rohit Dhawan" <rohit_reborn_at_yahoo.com> wrote in message news:c76d1c78.0404161545.550a50cb_at_posting.google.com...
| I am working on Oracle reports . One of the parameters that a User
| inputs is
| 'report_type'. Now, is there a way to do the following within a SQL
| query with no use of procedures or functions.
|
| select blaa from foo where
|
| something = something
| // if report_type='some_data' then
| and somethingelse = something else
| //else do nothing
|
|
| Also, IS there a way of doing something like the following
|
| // if report_type='some_data' then
|
| select blaa from foo where
| something = something
| // if report_type='some_data' then
| and somethingelse = something else
| //else do nothing
|
| else
| select blass1 from foo where
| something = something
| // if report_type='some_data' then
| and somethingelse = something else
| //else do nothing

couldn't quite follow all your pseudo code, but it looks like you might want to look into the case statement -- depending on the version of oracle you're running

;-{ mcs Received on Sat Apr 17 2004 - 03:57:27 CEST

Original text of this message