|
-
July 18th, 2005, 08:19 AM
#1
Case statement in Where clause / Informix
I need a little help with these case statments in my where clause. I don't need to display the results of the case statements, but I do need to put them in my where clause. Any help??
select distinct(r.studentid), r.studentname, r.building,
case when r.currcode like'D%' or r.currcode like 'W%' then rc.dual1 else r.currcode end Currcode,
case when r.currcode like'D%' or r.currcode like 'W%' then rc.dual2 else '' end Dual2
from reg r, bldgtype b, regtb_curr_code rc
where
r.status = 'A' and
b.type = 1 and
r.building = b.bldg and
r.currcode = rc.code and
(
case when r.grade in ('KA','KP','KF') then 'KG' else r.grade end or
case when r.grade in ('PA','PP','PK') then 'PK' else r.grade end
)
(r.building || '*' || trim(r.grade) || '*' || trim(r.currcode)) not in
(select s.bldg || '*' || trim(s.grade) || '*' || trim(s.prog) from seats s where seats >0)
Last edited by zombie_man23; July 18th, 2005 at 10:55 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|