查询系统时间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; |