Seven major Oracle Projects

Source: Internet
Author: User

The following articles mainly introduce the selection of rows in basic Oracle knowledge. It mainly includes the introduction of SELECT statements, how to handle NULL, and the description of the actual operation of NVL function to convert NULL to other types of symbols. The following describes in detail.

1. Simple SELECT statement

SELECT field name 1 [AS] 'field name 1 Interpreter 'FROM table;

2. process NULL

The NVL function converts NULL to other types of symbols.

Programming Skills: NVL functions are useful in Multi-condition fuzzy queries.

The NVL function can return multiple data types:

Returns the NVL (start_date, '2017-02-01 ') date ')

Returns the NVL (title, 'no title') string ')

Returns the NVL (salary, 1000) number)

3. Use SQL * PLUS1)

SQL> desc table; displays the table structure

SQL> select * from tab; view all tables under the user

SQL> set pause on; enables a large number of result sets to flip pages after you press Enter.

SQL> set pagesize 100; sets the number of rows on one page of the SQL statement returned result set to 100. The default value is 14.

SQL> set linesize 100; set the width of a row in the returned result set of SQL statements to 100. The default value is 80.

4. The display format of fields specified in SQL * PLUS in Oracle Basics

Display format of specified numbers

SQL> column field name format 99999999999;

SQL> column field name format 999,999,999,999;

SQL> column field name format a number [word_wrapped];

Specifies the display width of long characters.

SQL & gt; set long 200;

Specify the display content of the field name

SQL> column field name heading 'field name display content ';

SQL> set heading off; field names are not displayed during query.

Specifies the field alignment direction

SQL> column field name: justify [left | right | center];

Format of the cleared Field

SQL> column field name clear;

5. Example of the display format of fields specified in SQL * PLUS

SQL> column last_name heading 'employee | name' format a15;

SQL> column salary justify right format $99,999.99;

SQL> column start_date format a10 null 'not hired ';

NOTE: If start_date is null, the 'not hired' string is displayed'

6. Question (T/F)

(1). SQL command are always held in SQL buffer. [T]

(2). SQL * PLUS command assit with query data. [T]

5

J2EE @ zxw

The SQL * PLUS command only controls the display format and control file of the SELECT result set. Only SQL commands can access the database.

The above content is an introduction to the basic knowledge of Oracle. I hope you will gain some benefits.

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.