Friday, April 3, 2009

Nested Case statements

(CASE
WHEN custid is not NULL THEN custid
WHEN accountid is not null THEN accountid
Else refID
END) AS TranNo