---
title: "oracle 取整"
author: "smallsilver"
date: "2012-02-22T18:32:31Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2012-02-22T19:02:33Z"
id: 1418338
url: "https://wangde.iteye.com/blog/1418338"
---

1.取整(大)  　　    select ceil(-1.001) value from dual;
![](http://dl.iteye.com/upload/attachment/0063/6129/f974736c-934e-3f56-9d0d-e2494eb0251a.jpg)
　　
2.取整（小） 　　select floor(-1.001) value from dual; 　　
![](http://dl.iteye.com/upload/attachment/0063/6131/b199285f-50bd-3caf-8517-ed9014c02a31.jpg)

3.取整（截取）　 select trunc(-1.002,) value from dual;
中括号中意思是0位小数，1位小数。。。
![](http://dl.iteye.com/upload/attachment/0063/6135/8b5eb594-539a-3ec9-8df0-aa8c322f3c6d.jpg)
      
4.取整(舍入)           select round(*) value from dual;
![](http://dl.iteye.com/upload/attachment/0063/6118/ac1ee20e-685c-3034-9ddc-ca61f686e036.jpg)