CodeIgniter Forums
MySQL UNION statement and Query Builder? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: MySQL UNION statement and Query Builder? (/showthread.php?tid=77830)



MySQL UNION statement and Query Builder? - mlurie - 10-23-2020

Is there any way to write a MySQL UNION statement with Query Builder?  I have reviewed the documentation and cannot find the answer.


RE: MySQL UNION statement and Query Builder? - InsiteFX - 10-23-2020

PHP Code:
$this->db->query(); 



RE: MySQL UNION statement and Query Builder? - kenjis - 05-27-2022

Since v4.2.0 you can use UNION with Query Builder.
See https://codeigniter4.github.io/CodeIgniter4/database/query_builder.html#query-builder-union