MAX(CONVERT(column, TIME(3))) returns different values ​​from mysql client than JPA native query
P粉333395496
P粉333395496 2023-09-16 12:15:25
0
1
990

MAX(CONVERT(column, TIME(3))) The value returned from the mysql client is different from the value returned by the JPA native query. The first one is returning (in my sample data) the correct value 47:40:00.000, but the JPA native query returns 23:40:00 and don't know why since it has the native query flag.

P粉333395496
P粉333395496

reply all(1)
P粉270842688

The problem is because of the conversion from local time format (equivalent to sleep time) to string. I solved the problem of converting to string on MySQL.

@Query(value = "SELECT CAST(MAX(CONVERT(v.start,TIME(3))) AS CHAR) FROM variable v WHERE v.well IN ?1 ", nativeQuery=true);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template