oracle常用sql语句

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:48   1617   0

查询系统时间select to_char(sysdate,'yyyy-mm-dd hh:mm:ss') from dual

查询名称中既有a又有e字符 select * from act_ge_property where name_ like '%a%' and name_ like '%e%'

查询员工的姓名,以及在公司工作的月份数(worked_month),并按月份数降序排列

select last_name, months_between(sysdate, hire_date) worked_month from employees order by worked_month desc

查询此用户下所有表:

select * from dba_objects where owner='SYSTEM' and object_type='TABLE' and timestamp>='2019-09-04 00:00:00';

SELECT to_char(SYSDATE,'yyyy-mm-dd hh:mm:ss dd "of" month') FROM dual;双引号添加字符串
SELECT to_char(11111,'L99,999.00') salary FROM dual; 9为数字,L为系统货币,$
SELECT to_number('11,111.00') FROM dual;

查询表空间select username,
default_tablespace,
temporary_tablespace
from dba_users
where username='oratest';
select * from dba_tablespaces;

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP