O'Reilly logo

Oracle SQL: A Beginner’s Tutorial by Djoni Darmawikarta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9

Built-in Functions

The Oracle database provides functions that you can use in your queries. These built-in functions can be grouped into numeric functions, character functions, datetime functions, and functions for handling null values. The objective of this chapter is to introduce you to some of these functions.

Numeric Functions

The following are some of the more important numeric functions.

ABS

ABS(n) returns the absolute value of  n. For example, the following query returns the absolute value of (price - 20.00) as the third column.

SELECT p_code, price, (price – 20), ABS(price – 20.00) FROM product;

Applying the query to this product table

 

P_CODE P_NAME         PRICE LAUNCH_DT

------ --------- ---------- ---------

1      Nail              ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required