Creating a 'View' - 08-06-2003 , 11:11 AM
I want to create a 'view' but have a condition on a column based on another
column. Basically, I want to do this:
CREATE VIEW MyView
SELECT [id] AS dept_id,
[name] AS dept_name,
url WHEN STATUS = 'ACTIVE'
WHERE event_sharing = 'on'
What I want to do is only display the URL field when the Status = 'Active',
and if Status <> 'Acitve' I want to return a null/blank URL field.
Re: Creating a 'View' - 08-06-2003 , 12:28 PM
You can use a CASE expression like:
SELECT id, name,
CASE status WHEN 'Active THEN url END AS url
WHERE ... ;
( Please reply to newsgroups only )
Re: Creating a 'View' - 08-06-2003 , 12:33 PM
Thank you ... that is exacting what I was looking for
"Anith Sen" <anith (AT) bizdatasolutions (DOT) com> wrote