On Saturday, July 19, 2014 02:56:24 PM Reindl Harald wrote: > > ERROR 1064 (42000): You have an error in your SQL syntax; check the manual > > that corresponds to your MariaDB server version for the right syntax to > > use > > near 'DISTINCT sum) THEN sum(cost) ELSE NULL END AS cost_sum > > from prices group by name' at line 1 > > how do you imagine that to work? > what is the distinct in that context supposed to do?
Ohh. God. So simple it is - MariaDB [tutorial]> select name, sum(cost) AS cost_sum from prices group by name; +------+----------+ | name | cost_sum | +------+----------+ | A | 6700 | | B | 12000 | | C | NULL | +------+----------+ 3 rows in set (0.01 sec) Thanks. -- ================ Regards, Arup Rakshit ================ Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. --Brian Kernighan -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql