Oracle Basic Query Content collation

Source: Internet
Author: User
Tags clear screen

Clear Screen

Host CLS;

View Current User

Show user;

Tables under the current user

SELECT * from tab;

tab data Dictionary

DESC EMP;

Find information for all employees

SELECT * from EMP;

Querying by Column name

Select Empno,ename,job,sal from EMP;

Query employee number, name, salary, annual salary

Select empno,ename,sal,sal*12 from EMP;

Query employee number, name, salary, annual salary, annual income

Select Empno Employee number, ename name, Sal monthly salary, sal*12 annual salary, Comm Bonus, Sal*12+comm annual income from EMP;

Select Empno Employee number, ename name, Sal monthly salary, sal*12 annual salary, NVL (comm,0) bonus, SAL*12+NVL (comm,0) annual income from EMP;

Select Comm is empty

Select*from EMP where comm is null;

Distinct to remove duplicate records

Select Deptno from EMP;

SELECT DISTINCT deptno from EMP;

Select Job from EMP;

SELECT distinct job from EMP;

SELECT distinct deptno,job from EMP; Deptno and job combinations are not duplicated.

Select concat (' Hello ', ' world ') from EMP;

Select 3+2 from dual;

Select ' Hello ' | | ' World ' from dual;

Select Ename| | ' The salary is ' | | Sal

Oracle Basic Query Content collation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.