title: is it possible to use case statement + round() in database
body: <p>i have table called 'test' and want to calculate based on different codes, most of them should be saved in 5 decimals except certain code, like containing jpy in 3 decimals, and xua in 2 decimals</p>
  
  <pre><code>create table test(
        id int, ymd date,
        code varchar(10),
        price int
      )
  
  insert into test(id, ymd, code, price) values
     (1, '2019-01-01', 'auus', 75125),
     (2, '2019-01-02', 'nzus', 68541),
     (3, '2019-01-03', 'xuaus', 131485),
     (4, '2019-01-04', 'aujp', 77852),
     (5, '2019-01-05', 'usjp', 110852),
     (6, '2019-01-06', 'xuaus', 131091)
  </code></pre>
  
  <p>So my execute code is:</p>
  
  <pre><code>select id, ymd, code, price, 
   case
  when code like '%xua%' then round(price/100,2)
  when code like '%jp%' then round(price/1000,3)
  else round(price/100000,5)
  end as t
  from test  
  </code></pre>
  
  <p>ideal result: </p>
  
  <pre><code> id     ymd     code    price   t
   1  2019-01-01  auus    75125   0.75125
   2  2019-01-02  nzus    68541   0.68541
   3  2019-01-03  xuaus   131485  1314.85
   4  2019-01-04  aujp    77852   77.852
   5  2019-01-05  usjp    110852  110.852
   6  2019-01-06  xuaus   131091  1310.91
  </code></pre>
  
  <p>intersting, above sql works well with Mysql, but i am using mariadb, and just can't get results as same as mysql, spent 2 days to fix problem, but still don't know, please help </p>