Solution SQL SERVER round function with inoperable

In order to get the decimal numbers, usually using a round function after the decimal point two remain in the oracle and mysql but can not take effect in sql server.

Another function used here cast (digitally format conversion):
the floating-point numbers into

select  round (cast(20 as flocat)/74) //将20转为浮点数,再除以7,保留4位小数

In this way the use of decimal places can achieve the effect.

Published 14 original articles · won praise 0 · Views 6676

Guess you like

Origin blog.csdn.net/Anry_2018/article/details/104357924