oracle 常用sql

时间:2014-06-09 20:00:42   收藏:0   阅读:211

--1,随机抽取一条数据

select column from (select * from table order by dbms_random.value ) where rownum = 1;

--2,选取一个表中的重复数据

select column from table group by column having count(*) > 1

--3,日期截取

  1)如2012-4-27 9:20:22只截取后面的时分秒

      select to_char(sysdate,‘hh24:mi:ss‘) from dual

  

oracle 常用sql,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!