截取第一个符号前的字符串
--mysql
substring_index( i.`code`,'.',1);
substring_index( 字段,特定字符,第几次出现)
--oracle
substr('AAA-BBB',1,instr('AAA-BBB','-',-1)-1)