Is there any way to write union with query builder? |
In my project I am using datatables plugin with serverside processing. It works fine untill i do a search or order(sort) operation because it needs active record to do that.
My scenario is, i have an account table, revenue table and payment table, and I want to view all the data of revenue and payment table, thats why I need a union. my query is like below--- Code: SELECT 'Income' as source, fld_type, fld_amount, ta.fld_account as account, fld_date, tbl_revenue.fld_description as fld_traninfo, tbl_revenue.fld_created as created Is there any way to use query builder in this query? And second thing, you can see I created a virtual column named 'source', i want to filter this column using where clause like below Code: WHERE source like "%""%" limit(10,0) But this returns that I don't have any column name 'source', how can I filter this column? Any help is appreciated.
See this article:
UNION query with codeigniter's active record pattern What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |