We can overcome this issue by using the format3 of if-else, which allows us to nest other if-else or if statements inside the original ones up to any level, as per our convenience. If both variables are equal, we will display a message saying that “variable1 is not greater than variable2,” indicating that variable1 may be smaller or equal to variable2. RAISE NOTICE 'variable1 is not greater than variable2' Īs we can see here, we can’t check for the equal condition. RAISE NOTICE 'variable1 is greater than variable2' RAISE NOTICE 'variable1 is greater than variable2 ' ![]() Here, three separate if statements will be used to achieve our use-case requirement. Then, using the format 1 mentioned above, we will write the statements so that when variable 1 is less than, greater than, or equal to variable2, an appropriate message with the notice will be raised after they are compared using comparing operators. In our first example, we will consider two variables. This completely customizable structure can be used as per our convenience and requirement. ![]() Nesting, if inside or else of another, is also possible. We can use only if the statement if we want to execute certain statements on fulfillment of some condition, or we can use the second format where the control when the condition evaluates to true and when it evaluates to false is given can execute our statements accordingly.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |