in reply to Using DBIx::Class For Slightly Complex Queries

I'm not sure what you are trying to filter but (d.dept != 3 OR d.dept != 42) will always be true which makes the WHERE statement redundant.

I'm guessing you want
WHERE d.deptid != 1 AND d.dept != 3 AND d.dept != 42
poj

Replies are listed 'Best First'.
Re^2: Using DBIx::Class For Slightly Complex Queries
by jeffa (Bishop) on Aug 13, 2015 at 19:16 UTC

    Or perhaps even

    WHERE d.deptid != 1 AND d.dept NOT IN (3, 42)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re^2: Using DBIx::Class For Slightly Complex Queries
by phildeman (Scribe) on Aug 13, 2015 at 20:50 UTC

    Thanks. The WHERE clause should have AND. Can you help or guide me with the Perl code for DBIx::Class?

    Thanks.

    -Phil-