CodeIgniter 4 Query Builder union() and unionAll() methods

Joshua Otwell
Level Up Coding
Published in
5 min readDec 7, 2022

--

UNION and UNION ALL set operators return the combined rows from 1 or more SELECT queries. CodeIgniter 4 Query Builder now supports UNION and UNION ALL queries with the $builder->union() and $builder->unionAll() methods respectively. Learn how to create these types of queries in this article.

This article and many to follow, are part of a series of articles I am writing and sharing as I learn new concepts when I learn them. I think of it as a duty in sharing the things I learn as a self-taught developer. We all need to support one…

--

--

SQL | PHP | Photography. Sign-up for my free developer newsletter, OpenLampTech, here: openlamptech.substack.com