select distinct gv.geoname,gv.GeoHierLevelCode,
SUBSTRING_INDEX(SUBSTRING_INDEX(gd.geohierpath,'/',4),'/',-1)
from HavellsUserSalesForceMapping hs,geohiervalue gv,geohierpathdetails gd
where hs.userCode = '00000001'
and hs.cmpCode = gv.cmpCode
and gv.geoCode IN (hs.geoCode)
and gd.geohierpath LIKE CONCAT('%/',gv.geoCode,'/%') ;
SUBSTRING_INDEX对我来说是个问题。告诉我转换为hql的实际方法