What is the equivalent function of LEFT () in JPA?
I need to get only the first 6 characters of a field.
The equivalent select in sql would be:
select left(campo,6), count(*) qtd
from tabela
group by left(campo,6)
What is the equivalent function of LEFT () in JPA?
I need to get only the first 6 characters of a field.
The equivalent select in sql would be:
select left(campo,6), count(*) qtd
from tabela
group by left(campo,6)
There is no LEFT () function in jpa!
The documentation restricts the capture of string portions only to the SUBSTRING () function.
ex:
select substring(v.campo, 1, 6), count(*)
from V v
group by substring(v.campo, 1, 6)