hibernate - HQL : Order by varchar2 as INT -


i'm working on statement in hql , have results sorted numbers.

kind of results can have : dr71 frein resf-37 r-37 ...

i have sorted numbers composed of.

i had :

select distinct r.type  reference r order replace(replace(replace(r.type, '-', ''), 'f', ''), ' ', '') 

it enough because @ beginning, r, - , f used. have solution supporting every characters.

i tried :

order cast(r.type int) 

but gives sql error: 1722, sqlstate: 42000

any idea how ?


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -