Round () function, null value in Oracle, RowNum

Source: Internet
Author: User
Tags numeric value table definition

Round () Function: Rounding function

Returns a numeric value that is the result of rounding operations with the specified precision.

Syntax: Round (number[,decimals])

Number: The function to be processed

Decimals: Precision, default is 0;

Select round (123.456,0) as A,round (123.456,1) as B,round (123.456,-1) as C from dual;

Null value:

A null value is no value or missing value. A column that allows null values also allows the column's value to be not given when the row is inserted. Columns that do not allow null values do not accept rows with no values for the column, in other words, the column must have a value when the row is inserted or updated.

Each table column is either a null value or a NOT NULL column, which is created with a table definition, such as:

CREATE TABLE Orders (  order_num  INTEGER not  null,  order_date DATETIME not NULL,  order_id   CHAR (ten) not NULL);

The above statement creates a table with 3 fields, each of which is qualified by the keyword NOT null, so inserting a column with no value will return an error and insert failed.

RowNum

RowNum can only be used for < If you want to use it, you can use the two methods to achieve:

With Row_number () over ():

Select Areaid from        (select Areaid, Row_number () over (order by Areaid) T from        Cumenu) K         where T > 5;

Instantiation:

Select Areaid from        (select Areaid, RowNum r from          cumenu)         where r > 5;

---------

This series for the recent period of time to learn Oracle's learning notes, recorded in this as their own review, some of the network, some of the books, but the time has long, remember what is quoted, if reproduced but not marked out, specifically apologized.

Round () function, null value in Oracle, RowNum

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.