Zend Framework 2 Sql Select with OR and AND

后端 未结 2 697
囚心锁ツ
囚心锁ツ 2020-12-30 10:49

I want to make this query using Zend\\Db\\Sql\\Select:

SELECT table1.* FROM table1 
    INNER JOIN table2 ON table1.columnA = table2.columnB 
    INNER JOIN          


        
2条回答
  •  感情败类
    2020-12-30 11:09

    from the top of the head using Where fluent interface:

    $select->where
           ->nest
               ->equalTo('table2.column2', 2)
               ->or
               ->equalTo('table2.column3', 3)
           ->unnest
           ->and
           ->equalTo('table1.column1', 1);
    

提交回复
热议问题