Findall In Relational Tables With != Condition
Posted 19 December 2012 - 10:24 AM
I have two tables jobStatus and notifiactionRules, structures of tables are:
id : PK
id : PK
status_id : FK
i want to write a condition in findAll, such that i have to get the names of all job status that are NOT IN notifiactionRules.
I tried this:
$jobstatuslist = CHtml::listData(JobStatus::model()
but i am getting error - Undefined offset: 2
can anyone pls help.......
Posted 20 December 2012 - 04:57 AM
you can also use SQL in findall, for instance in postgresql it would be something like
...::model()->findAll(array('condition'=> "not exists (select 'a' from notifiactionRules where notifiactionRules.status_id = JobStatus.id)"));
Posted 20 December 2012 - 04:48 PM