Previous Topic Next topic Print topic


Using AND and OR on Different Columns

Values in different columns on the same row are treated as AND conditions. Values in different rows are treated as OR conditions. Look at the following Query Conditions Grid example.

This yields the following SELECT statement:

SELECT  E1.e_no, E1.lname, E1.payrate, E1.st, E1.com
FROM    TUTORIAL.TUTORIAL.EMPLOYEE E1
WHERE    ((E1.e_no Between 2 and 8) 
        OR (E1.lname like ""hur%"") 
        OR ((E1.payrate >4 
            AND E1.payrate < 15) 
            AND (E1.com is null)) 
            OR (E1.st <> "MD"))
Previous Topic Next topic Print topic