select CAST(SUBSTRING(CAST(3.1415926 AS CHAR(40)),1,LOCATE('.',CAST(3.1415926 AS CHAR(40)))+8) AS DECIMAL(20,8))