i tried this one but with no luck. My requirement is that i have a table called 'tabAccount'. it has some duplicate values and null values for the field 'parent_account'. I want to select only the distinct values for the field parent_account, also field group_or_ledger with value Ledger and field root_type with value Expense . How can i do this?
i tried something like this
$expense = TabAccount::find()->select('DISTINCT `parent_account`')->where(['root_type'=>'Expense'])
->andWhere(['group_or_ledger'=>'Ledger'])
->andWhere(['not', ['parent_account' => null]])->all();