Hi all,

I'm trying to have a case statement in my SQL select , but ZF is not
allowing me, any suggestions:

Here's my code:


$select = $this->select()->setIntegrityCheck(false);
$select->from('car',array(
            'car_id'          => 'car_id',
            'car_name'        => 'car_name',
            'quantity'          => 'count(car_id)',
    )
)
->join('parking','parking.parking_id = car.parking_id',
    array(
            'license_type'      => $db->quote("CASE is_eval WHEN 1 THEN
'EVAL' ELSE 'FULL' END"),
            'date_expires'      => 'date_expires',
    )
);


and here's the error:


SQLSTATE[42S22]: Column not found: 1054 Unknown column 'parking.'CASE
is_eval WHEN 1 THEN \'EVAL\' ELSE \'FULL\' END'' in 'field list''



Thanks a bunch for your responses in advance.

-- 
View this message in context: 
http://www.nabble.com/SQL-Case-statement-in-Zend-Framework-tp21879020p21879020.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to