Zend Framework Select Objects And UNION()
mysql, php, select, union, zend-framework
Solution
Zend_Db_Select has a union method so I'd have thought it is possible, if you can build your query using a select object. I haven't used Zend_Db_Select (or the table subclass) with union but I'd imagine you can do something like
$select = $this->select()
->where('blah')
->union($sql);
Problem
I'm pretty sure this is not possible in Zend Framework (I have searched the Web, the documentation and issue tracker) but I just want to make sure so I'm asking here. ``` $select = $this->select(); $select->union($select1, $select2); ``` That doesn't work of course. To explain what I need. I need to use UNION() to merge 2 tables in a SELECT query, I know I could just do: ``` $select = "$select1 UNION $select2"; ``` The problem is that would return a string and I need to get a select object so I can use it with Zend_Paginator. I have already solved the issue by modifying my database architecture but I'm just curious if there is some workaround for this.