0

我正在使用 symfony1.4 和学说。我需要检查值为 的条件NULL。我需要写一个查询 where status = 1and start=NULLand end= NULLand estimated_time != NULL。我已经尝试过了,但我无法得到结果。

            $tickets = Doctrine_Core::getTable('table')
              ->createQuery('a')
              ->where('status=?','1')
              ->andWhere('start=?', '')
                              ->andWhere('end=?', '')
              ->andWhere('estimated_time!=?','')
              ->orderBy('id DESC');

任何帮助将不胜感激。谢谢你..

4

1 回答 1

1

尝试使用IS NOT NULL

$tickets = Doctrine_Core::getTable('table')
    ->createQuery('a')
    ->where('status=?','1')
    ->andWhere('start IS NOT NULL')
    ->andWhere('end IS NOT NULL')
    ->andWhere('estimated_time IS NOT NULL')
    ->orderBy('id DESC');
于 2012-04-16T06:01:57.913 回答