SQL除法小数点位数问题
表内容如下: 
 e10                                                   e11                                                      e9 
 8412.277206	8412.27720679	1.00000000 
 它们的数据类型都为numeric(16,8) 
 但执行select   e11/e9   from   table   时,值为8412.277206   切除了后面两位小数,请问这是什么原因?如果要精确到8位小数要怎么做? 
------解决方案--------------------没理由会这样啊,不明白什么原因   
 可以试试转换一下 select cast(e11/e9 as numeric(16,8)) from table  
------解决方案--------------------select cast(cast(e11 as float)/cast(e9 as float) as decimal(18,8)) from table  
------解决方案--------------------select cast((e11*1.00/e9) as decimal(18,2)) from table 试试这个
------解决方案--------------------转换为decmail
------解决方案--------------------楼上的是decimal,不是decmail
------解决方案--------------------/* 
 哈,大家看出什么规律了吗? 
 */ 
 declare @a numeric(38,20),@b numeric(38,0),@c numeric(38,1),@d numeric(38,2),@e numeric(38,3),@f numeric(38,4),@g numeric(38,5) 
 select @a=1.12345678912345678912, @b=1, @c=1, @d=1, @e=1, @f=1, @g=1 
 print @a 
 print @a/@b 
 print @a/@c 
 print @a/@d 
 print @a/@e 
 print @a/@f 
 print @a/@g 
------解决方案--------------------create table table_a(e10 float,e11 float,e9 float) 
 insert into table_a select 8412.27720,68412.27720,6791.00000000   
 select cast(e11/e9 as numeric(18,8)) from table_a   
 --------------------------------------- 
 10.07396219