Merging Csqldataprovider Into One Based On Common Column

Can i Merge two different [b]CSqlDataProvider /b into one? if possible Please help me! I search but found only merging of criteria which is NOT working for me!.



Are you making an UNION between sql provider?

thanks for reply, i m not making UNION BUT i want to merge two data provider: my problems is "

I have to show the result of data which is filter and full and comparion with them in cgridview







I had the problem in writing SQL(like having both inlist and all !!) query,so i was thinking if we can merge the dataproviders, then it easy then!!

With a problem of this type, i’ve subclassed CGridView and then rendered footer’s cell with specific method

to display correctly result of data.

Anyway, you could try to use GROUP BY … WITH ROLLUP function (if you are using MySQL for example) at the end of sql,

but i don’t know your sql to say that this could be implemented easily.

thanks for reply

I’ve once did a similar task: I needed a custom data provider that gets data from two sources. Basically, I’ve created a custom class that extends CDataProvider. This class implemented the following methods in order to achieve what I needed to override __construct(), fetchData(), fetchKeys(), calculateTotalItemCount() plus write several custom methods.

I suggest that if you cannot escape your need that you ‘dive into’ CDataProvider and create your own custom one.