Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1.  
  2.  
  3. $col = array();
  4. $col["title"] = "Total ordered";
  5. $col["name"] = "total_order";
  6. $col["search"] = true;
  7. $col["editable"] = false;
  8. $cols[] = $col;
  9.  
  10. $g->select_command = "SELECT m.material_id, SUM(orders.material_quantity) as total_order
  11. FROM materials m
  12. LEFT JOIN orders
  13. ON m.material_id = orders.material_id
  14. GROUP BY m.material_id
  15. ";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement