http://qs321.pair.com?node_id=1138564


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

Here is an example of what I think you are trying to achieve. This is rough untested code so may not work but should give you some idea of where to go next. If you post your attempt at the query, with details of the errors you are getting, someone may be able to provide more help.

Schema::Room->search( { departments.deptid => { '!=', 1 }, -or => [ departments.dept => { '!=', 3 }, departments.dept => { '!=', 42 }, ], }, { join => ['departments'] group_by => 'departments.deptid', } );