Variables in SQL Query [message #423857] |
Mon, 28 September 2009 13:48  |
myorafaq
Messages: 3 Registered: September 2009
|
Junior Member |
|
|
Hi,
I have a sql query like this that will have variables:
select
* from AUDIT_RUN_HISTORY
where
(ENT_TIME - START_TIME) BETWEEN &LOWER_LIMIT AND &UPPER_LIMIT;
My req is a) if i didn't give a value for LOWER_LIMIT then it has to take 0 value as LOWER_LIMIT.
b) if i didn't give a value for UPPER_LIMIT then it has to take only LOWER_LIMIT value.
I need to do this in SQl Query only.Any help is appreciated.
Thanks
Sekar
|
|
|
|
|
Varaible in Where condition of SQl Query [message #423867 is a reply to message #423857] |
Mon, 28 September 2009 16:28   |
myorafaq
Messages: 3 Registered: September 2009
|
Junior Member |
|
|
I have a SQL query like this:
select
* from Job_Table
where
(ENT_TIME - START_TIME) >= &LOWER_LIMIT;
Here is my Req:
a) if i didn't give a value for LOWER_LIMIT then it has to take 0 value as LOWER_LIMIT.
b) if i have given a value for LOWER_LIMIT then it has to take that value for LOWER_LIMIT.
Thanks for looking
Sekar
|
|
|
|
|