ken
1
How can i use sql query for example below
SELECT A,B,C FROM XYZ WHERE A IN (‘1’,‘2’,‘3’) ;
NOTE: doesn’t understand how to use below statement? please guide how can i use sql query as below to retreive data ?
$a = $this->C->find(‘all’, array(‘fields’ => array(‘C.ITEMNUM’, ‘C.CHM’), ‘conditions’ => array(‘C.TANKNAME’ => ‘Alkaline 03’, ‘C.POWD’ => ‘PF’, ‘C.USED’ => 1)));
ken
2
is it like this
$this->C->find(‘all’,array(‘fields’ => array(‘C.A’, ‘C.B’ ,‘C.C’), ‘conditions’ => array(‘C.A’
IN ( ‘=> ‘1’ .’,’ . ‘2’ .’,’ . ‘3’ . ‘)’
)));
please let me known how to use “IN” condition .
SELECT A,B,C FROM XYZ WHERE A IN (‘1’,‘2’,‘3’) ;
aavrug
3
Try this :
$this->XYZ->find(‘all’, [‘conditions’ => [‘A IN’ => [1, 3]], ‘fields’ => [‘XYZ.A’, ‘XYZ.B’, ‘XYZ.C’]]);