|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
Please can anyone help? I am using oracle reports 6i and really need to know how and if you can use an IF..ELSE statement. It is very frustrating as I am also new to this tool. So far all my queries have been fairly straight-forward SELECT, FROM and WHERE.Thanks |
|
#2
|
|||
|
|||
|
I have to admit that I am not that familiar with Oracle, but one standard method for SQL IF statements is to wrap them inside a CASE WHEN... THEN... END block:
Code:
SELECT mycolumn1,
(CASE
WHEN mycolumn2 > 5
THEN 'greater than 5'
ELSE
WHEN mycolumn2 = 5
THEN 'is 5'
ELSE 'less than 5'
END) AS amount
FROM mytable;
__________________
The real n-tier system: FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL Amazon wishlist -- rycamor (at) gmail.com |
|
#3
|
||||
|
||||
|
The Oracle equivalent of IF/CASE is DECODE, check this -> http://www.ispirer.com/doc/sqlways3...sql_ora_fn.html
|
![]() |
| Viewing: Dev Shed Forums > Databases > Database Management > Oracle Reports 6i and IF statements |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|