Home > Database > Mysql Tutorial > body text

oracle与sqlserver小结

WBOY
Release: 2016-06-07 15:18:20
Original
929 people have browsed it

查看所有用户 select * from all_users; select * from dba_users;select * from user_users; 查看SID select * from v$instance; 查看所有表空间 select * from v$tablespace; 查询表空间文件所在路径 select * from dba_data_files; 一:取得系统当前时间

查看所有用户 

select * from all_users; 
select * from dba_users;
select * from user_users;
Copy after login

查看SID

select * from v$instance;
Copy after login

查看所有表空间

select * from v$tablespace;
Copy after login
查询表空间文件所在路径
select * from dba_data_files;
Copy after login


一:取得系统当前时间

SQLServer  select getdate();
Oracle     select sysdate from dual;
Copy after login

二:日期比较

SQLServer  select * from tab where Order_date > '1990-04-13';
Oracle     select * from tab where Order_date > date '1990-04-13';
Copy after login


三:NOt

Not逻辑运算符用来将表达式结果进行"反向"判断,以下将以比较运算符中的不等于(!=)并利用比较运算符中的等于(=)与逻辑运算符Not进行结合

select count(*) from orders where book_name != 'java基础'
select count(*) from orders where not book_name = 'java基础'
Copy after login

由上述SQL语法可知,当NOT逻辑运算符与比较运算符合并使用时 是将NOT置于比较运算符的前面


四:order by排序

select book_id,book_name from orders order by 1 desc,2 desc
Copy after login


 

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template