---
title: "查询结果保留小数位"
author: "jslfl"
date: "2010-12-31T11:42:54Z"
tags: []
categories: ["数据库"]
slug: "untitled"
draft: false
lastmod: "2010-12-31T11:42:54Z"
id: 856710
url: "https://jslfl.iteye.com/blog/856710"
---

select   cast(10.1265456 as decimal(10,2))
--10.13

如果想四舍五入的话，可以嵌套round

select   cast(round(10.1265456,2) as decimal(10,2))
--10.13


