0
我有代码:Zend_Db的 - 工会
$balanceModelCredit = new Model_BalanceCredit();
$balanceModelDebt = new Model_BalanceDebt();
$selectQueryDebt = $balanceModelDebt->select()
->from('balance_debt', array('date',
'amount',
'description',
new Zend_Db_Expr('"koszta"')
));
$selectQueryDebt->where('balance_id=?', $balance_id);
$selectQueryCredit = $balanceModelCredit->select()
->from('balance_credit', array('date',
'amount',
'description',
new Zend_Db_Expr('"przychod"')
));
$selectQueryCredit->where('balance_id=?', $balance_id);
我该怎么办联合声明?
您的查询返回不同的列。仅当每个查询返回相同的一组列时,才可以使用联合。 –
@DanielGadawski:对不起,'UNION'只需要有相同的列数和相同的列类型,但对列名无关紧要...... –