var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: nested conditions
I have a SQL Server that makes imports from an Oracle database.
I'm using queries to select the rows I want from the Oracle.
My problem is I can't get the syntax right when I'm selecting a datecolumn.
SELECT DATE1 WHEN DATE1 IS NOT NULL ELSE
SELECT DATE2 WHEN DATE2 IS NOT NULL ELSE
SELECT DATE3 WHEN DATE3 IS NOT NULL ELSE
I've tried with nested CASE but can't get it to work.
please try this:
select nvl (date1, nvl (date2, nvl (date3, '2004-11-01')))
With Oracle 9i, you can also use the coalesce function, which returns the first non - null value from a list, all elements being of the same datatype.
select coalesce (date1, date2, date3, '2004-11-01')
The first non-null date value will be returned to you.
Both solutions works like a charm---
I'll go with the coalesce though since it's easier to use.