Calc Column / Sum from other table

QuestionsCalc Column / Sum from other table
bazel asked 5 years ago

I wrote a function to add new column which SUM column from another table.
The function is working good but I cannot sort or search in that column. Is there any other way to get this working ?

Here is the code
http://pastebin.com/BrDPWjup

3 Answers
Abu Ghufran answered 5 years ago

For search/sort, this must be part of main sql query, perhaps something like subquery.

bazel answered 5 years ago

I think I solved this with custom query in select_command
here is the solution if anyone needs
http://pastebin.com/fvkeknbz

Abu Ghufran answered 5 years ago

For search, you might need to use:

$col["dbname"] = "SUM(orders.material_quantity)";

After that, this will be used in WHERE clause and not the alias.

Your Answer

0 + 16 =

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!