Nội dung text Untitled document - 2024-09-02T162355.709.pdf
END IF; 3. Nested IF Statement You can nest IF statements within each other to handle more complex logic. IF condition1 THEN IF condition2 THEN -- statements to execute if condition1 and condition2 are true ELSE -- statements to execute if condition1 is true and condition2 is false END IF; ELSE -- statements to execute if condition1 is false END IF; Example: IF v_number > 0 THEN IF v_number > 10 THEN DBMS_OUTPUT.PUT_LINE('The number is greater than 10.'); ELSE DBMS_OUTPUT.PUT_LINE('The number is between 1 and 10.'); END IF; ELSE DBMS_OUTPUT.PUT_LINE('The number is zero or negative.'); END IF; 4. IF-ELSIF-ELSE Statement Practicalkida.com