Help for CASE statement

Help for CASE statement

 

  


Dear listers.


When I run this SQL,

SELECT DISTINCT(DBNAME||TSNAME), ICTYPE, SUBSTR(DSNAME,1,4),
(CASE ICTYPE
WHEN 'F' THEN 'FULL BACKUP'
WHEN 'Y' THEN 'LOAD LOG(NO)'
WHEN 'Z' THEN 'LOAD LOG(YES)'
WHEN 'I' THEN 'COPY FULL NO'
WHEN 'R' THEN 'LOAD REPLACE LOG(YES)'
WHEN 'S' THEN 'LOAD REPLACE LOG(NO)'
ELSE 'OTHERS'
END)
FROM SYSIBM.SYSCOPY
WHERE DBNAME = 'MIRP'
ORDER BY ICTYPE;

I get tablespace names with F TYPE and then same tablespace names with Y
and/or Z and other types as you see below.

MIRP AIQO F bkp.
MIRP AIQO F bar.
MIRP AIQO Z


My question is how can I make a tablespace name appear with only 'F'
type when the same tablespace has other type? On the above query result
I don't want to see the last line that says, 'MIRP AIQO Z'. How
should I modify this statement?


Thanks

James

DB2 & UDB email list listserv db2-l LazyDBA home page