2016-03-02 71 views
0
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爲me.Tell讓我問題的實際辦法轉換爲HQL轉換MySQL查詢HQL

回答