Re: DISTINCT not working inside a CASE statement.

2014-07-19 Thread Arup Rakshit
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 p

Re: DISTINCT not working inside a CASE statement.

2014-07-19 Thread Reindl Harald
Am 19.07.2014 13:45, schrieb Arup Rakshit: > Here is my simple table > > MariaDB [tutorial]> select * from prices; > ++--+--+ > | id | name | cost | > ++--+--+ > | 1 | A| 1200 | > | 2 | A| 2500 | > | 3 | A| 3000 | > | 4 | B| 5000 | > | 5 | B| 7000

DISTINCT not working inside a CASE statement.

2014-07-19 Thread Arup Rakshit
Here is my simple table MariaDB [tutorial]> select * from prices; ++--+--+ | id | name | cost | ++--+--+ | 1 | A| 1200 | | 2 | A| 2500 | | 3 | A| 3000 | | 4 | B| 5000 | | 5 | B| 7000 | | 6 | C| NULL | ++--+--+ 6 rows in set (0.00 se