where
if prog.levelnumber = 2 then
i.level = 2 ---> select only the persons with level = 2
if prog.numnivel=1 then
i.level = 1 ---> select only the persons with level = 1
views:
63answers:
1
+2
A:
This looks like SQL to me, so I'm answering it in that way...
Use a case
statement:
select fields
from tablename
where i.level = case prog.levelnumber
when 2 then 2
else
case prog.numnivel
when 1 then 1
end
end
Ian Kemp
2009-08-27 16:47:51