Hello
try this:
CREATE VIEW SUM_CUST_VW AS
SELECT MONTH(CLOSE_DATE) AS MONTH_VW, YEAR(CLOSE_DATE) AS YEAR_VW,
CASE
WHEN CODE IN ('/////', '/ *', '//////////*') THEN ?N?
ELSE ?Y?
END AS CODE_VW
FROM SUM_CUST
Note - If code = blanks is not valid, for you , please include blanks in
the IN values
Isa
"Bala Sosale " <db2udbdba-ezmlmshield-x86587613.[Email address protected]
29-11-2004 21:39
To
"LazyDBA Discussion" <[Email address protected]
cc
Subject
Creating views - need help
Dear list,
I am trying to create view from a table for the following conditions.
1. I need to extract only month from a date field (close_date)
2. I need to extract only year from a date filed(close_date).
3. I have a column in the table called code which has values : blanks,
alphanumeric chars(valid), '/////', '/ *', '//////////*' in my view I
should be adding a new column and add value "Y" to all the rows with
alphanumeric chars(valid) and "N" to all others
what would be the create view syntax for the above say if the name of the
table called SUM_CUST?
Thanks for your help
Bala
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page