您的位置:首页 > 博客中心 > 数据库 >

Oracle 常用SQL

时间:2022-03-15 01:55

--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

热门排行

今日推荐

热门手游