Re: [h2] Value is different for AVG(CAST AS DECIMAL)

2022-04-08 Thread Noel Grandin
I think you will need to cast to something like DECIMAL(20,2) i.e. specify
the precision and scale

On Thu, 7 Apr 2022 at 21:49, Jane  wrote:

> Hi All,
>
> I am upgrading H2 from 1.4.197 to 2.1.210. I have a query which casts a
> value to DECIMAL, as - SELECT AVG(CAST(A AS DECIMAL). Column A is INTEGER.
>
>  In older H2, this used to produce a value like 10002.5 and in 2.1.210,
> the same query produces 10002.0. What's happening internally here? Is there
> anything I can do to make this behave like in 1.0?
>
> The same query is being used across multiple databases (oracle, Postgres
> etc). That is why.
>
> Thanks,
> J.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to h2-database+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/h2-database/66a79014-70be-47c6-9f16-7d3328a269a4n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAFYHVnXkxsCy8_m9hNs%3DJv48H%2BOSFwvUFG%2Btehg4D9hTfnJ7sA%40mail.gmail.com.


Re: [h2] Error 50000-210: org.h2.jdbc.JdbcSQLNonTransientException

2022-04-08 Thread Noel Grandin
If you can provide a standalone test case, we can probably debug the issue

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/CAFYHVnV3%3Dpr7DPpgxJP3gjx%2BfNApSVF%2BPuARnhhxpnh7D%2Bzd7Q%40mail.gmail.com.