case when WBOOK_NO like '%H%' and WBOOK_NO not like '%HW%' then SUBSTRING(WBOOK_NO,7,9)
when WBOOK_NO like 'H%' and then SUBSTRING(WBOOK_NO,8,9) end,
WBOOK_NO
from EMS_PDE_HEAD WHERE WBOOK_NO='H3001720130823003698' OR WBOOK_NO='HW300172012048035872'
LIKE'H%'时再andNOTLIKE'HW%'就好啦