2009-08-27 5 views
0
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 
+3

s'il vous plaît essayer de clarifier votre question - grâce – fbrereto

+2

Qu'est-ce que la langue est-ce? – aehlke

Répondre

2

Cela ressemble à SQL pour moi, donc je répondre de cette façon ...

Utilisez une déclaration case:

select fields 
    from tablename 
where i.level = case prog.levelnumber 
        when 2 then 2 
        else 
        case prog.numnivel 
         when 1 then 1 
        end 
       end 
Questions connexes