---
title: "oracle常用sql"
author: "youyang_java"
date: "2013-04-23T10:32:12Z"
tags: []
categories: ["数据库"]
slug: "oracle-sql"
draft: false
lastmod: "2013-05-06T11:45:55Z"
id: 1851829
url: "https://youyang-java.iteye.com/blog/1851829"
---

1、to\_char(to\_date(xxDate,'yyyyMMdd')+1,'yyyyMMdd')  日期可以直接加减，+1，表示加一天

 

2、select to\_char(systimestamp, 'yyyyMMddHH24missff3') from dual;  精确到毫秒

 

3、insert into xx (id,name,age,size,price)  select seq\_yy.Nextval,?,age,?,? from t\_zz where id = ?

 

4、select * from t\_xx where status = ? and rownum &lt;= 10 一次只处理10条

 

5、select id,case when xx = '1' then yy else zz end oo from tt where  rownum &lt;= 10  case when的使用