sql - Ignored characters in Where-Clause? -
i have following problem:
i try select below 'g-'
seems ignores - , selects g , below.
select * tablea columna > 'g-' order columna
if use > 'g-t'
ignores '-'
totally, giving me things 'gt...'
the sorting value of '-'
lower 1 't'
'g-'
lower 'gt'
.
so
select * tablea columna > 'g-' order columna
will return 'gt'
, but
select * tablea columna < 'g-' order columna
won't. '-'
not ignored, it's lower 't'
.
of course, same goes if try using columna > 'g-t'
, same reasons.
if want select starts 'g-'
, use like
:
select * tablea columna 'g-%' order columna
- see this fiddle showing results.
Comments
Post a Comment