Welcome Guest, Not a member yet? Register   Sign In
Add union() to DB Query Builder
#5

(06-14-2017, 11:04 AM)skunkbad Wrote: I don't know. With a properly designed database, there's almost never a good reason to use UNION. There are no performance benefits to using it vs separate queries. It's rarely needed.

I completely agree with skunkbad here. I've even logged in after a couple of months of lurking to comment.

Using UNION is a Dark Path and should be avoided as much as possible.

Codeigniter's strength is being lean. The introduction of db->union() would bloat CI and then promote bad practice.

BUT - I know the world is a messy place and occasionally we need to engineer nasty solutions, so perhaps:

  1. Do what skunkbad has said and run 2 queries or
  2. this type of function is best left to a Library that could be maintained outside CI.
Reply


Messages In This Thread
Add union() to DB Query Builder - by krystian2160 - 06-14-2017, 08:26 AM
RE: Add union() to DB Query Builder - by skunkbad - 06-14-2017, 11:04 AM
RE: Add union() to DB Query Builder - by zurtri - 06-14-2017, 04:09 PM
RE: Add union() to DB Query Builder - by skunkbad - 06-14-2017, 05:58 PM
RE: Add union() to DB Query Builder - by kilishan - 06-14-2017, 08:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB