Divide two integers to get a decimal

1. SQL Server

select  Round ( convert ( float , sum (t1fs)) / convert ( float , count (bc_code)), 2 ) 
select Round( convert( float, 5) / convert( float, 8), 2 )
-- first convert to float type, then use the Round function, keep two digits, and round.

2. sybase

 

3.oracle

 

4.Mysql

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324888109&siteId=291194637