Entries tagged as: sum

2011
12-19

mysql sum error

In Blog | Tags: ,
Today I was fighting with strange error.
  1.  
  2. SELECT
  3. -- ...
  4. (
  5. (SELECT SUM(t.v)
  6. FROM tab1 t
  7. )
  8. +
  9. (SELECT SUM(t.v)
  10. FROM tab2 t
  11. )
  12. ) AS x
  13. -- ...
  14.  
Something like that give me NULL in x in every row even if there was a lot of records in tab1. (more…)