RE: Help for CASE statement

RE: Help for CASE statement

 

  

James

Yo must add a filter "AND ICTYPE = 'F' "
After statement WHERE DBNAME = 'MIRP'
Bye..


Adriana Lucia Domingues
Soporte Hostt
Gerencia Tenologia
Teléf: 02-336-8907
Anexo: 68907
[Email address protected]





-----Mensaje original-----
De: Park James Y. [mailto:db2udbdba-ezmlmshield-x67939527.[Email address protected]
Enviado el: Martes, 29 de Agosto de 2006 12:27
Para: LazyDBA Discussion
Asunto: 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


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
To post a dba job: http://jobs.lazydba.com
To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html



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