0
Good morning, everyone!
Using the Query:
@Repository
public interface SessaoRepository extends AbstractRepository<Sessao, Long> {
@Query(value = "SELECT p FROM Sessao p WHERE p.dc_secao =:dc_secao")
Sessao getDcSessao(@Param("dc_secao") String dc_secao);
}
I have a return that is a number, the problem is that within the table Sessao
the data within dc_secao
may be in these two cases:
dc_secao | cod_secao
SECAO DO FUEGO 123810230
/t/tSECAO DE GELO\t\t 3123131313
I mean, in case I look SECAO DE GELO
I won’t return anything, there is some Query
where I can ignore these spaces (represented by \t
) to bring the results independent of the lateral spaces?
I’ll try it, thanks
– Matheus Ribeiro
Trim is not working as expected, and like is problematic because it returns more than one query result that should be unique. It seems that postgres does not remove t with Trim..
– Matheus Ribeiro
Matheus, maybe you don’t have spaces or only spaces, if it is a tab, Trim may not work, test with btrim, I edited and put an example, if it doesn’t work, try to find out what exactly this character is, because it doesn’t seem to be just a space.
– Daniel Mendes
The combination of
trim
andbtrim
was enough, thanks.– Matheus Ribeiro