Wednesday, November 24, 2010

Single Line Functions

The single line function work on individual columns from individual rows and return one result per row.


The single line functions take different types of arguments, work on data item from each row, and return one value back for each row.

The different single line functions are:

 Numeric functions

 Date functions

 Character functions

 Conversion functions

NUMERIC FUNCTION:

ABSOULTE:

Abs() function is used to display the absolute value of a specified value, (i.e) negative into positive value.

COS:

Cos() function is used to find the cosine value.

LOG:

Log () function is used to find the logarithmic value.

POWER:

power() function is used to find the power value of specified value.

SQRT:

sqrt() function is used to find the square root value.

CEIL:

ceil() function is used to display round up value.

FLOOR:

floor() function is used to display the value truncating the decimal point value.



SIGN:

sign() function is used to display the first element.

MOD:

mod() function is used to calculate the modulus value.

TAN:

tan() function is used to find the tangent value.

TRUNCATE:

trun() function is used to truncate the floating point value and display.

DATE FUNCTION:

SYSDATE:

It is used to display the current date.

ADD FUNCTION:

It is used to add the months to the current date.

LAST_DAY:

It is used to display the last day of the current date or given date.

NEXT_DAY:

It is used to display the next day of the specified day. It specifies the date of the next day.

ROUND:

It is used to display the current date.

GREATEST:

It is used to display the end of the month.

CHARACTER FUNCTION:

The character function are used to manipulate in the characters.

INITCAP:

It is used to display the initial letter in capital letter, if it small.

UPPER:

It is used to display the string in upper case, that it is in lower case .

LOWER:

It is used to display the string in lower case, if it is upper case.

LENGTH:

It is used to find the length of the string. It display the number of strings(characters).

REPLACE:

It is used to replace the string with another string. It can also be used to replace the name.

LPAD:

It is used to display the special character with the specified character and number of character in left.

RPAD:

It is used to display the special character with the specified character and number of character in right.

LTRIM:

Ltrim() function is used to truncate the space in the left. It displays the string truncating the left space if any.

RTRIM:

It is same as ltrim, it display the string truncating the right space.

SUBSTRING:

The function substr() is used to display the string that specified with number to display.

TRANSULATE:

Transulate() function is used to transulate the character into another character.











CONVERSION FUNCTION:

TO_CHAR:

It is used to convert the system date into character. Specify the date format in character as dd month YYYY, it displays, in month as character and the date and year in numerics.

TO_DATE:

It is used to convert the format into character. It displays the month in character, if specified.

TO_NUMBER:

It is used to display the number. It can also add the two numbers.

TRUNC:

It is used to select the user id, it displays the user number.



GROUP FUNCTIONS:

NO NAME

1 Aaa

2 Bbb

3 Ccc

4 Ddd

MIN:

The function min() is used to display the minimum value. In the table, min(no), 1 is selected.

MAX:

The function max()is used to display the maximum value. In the table, max(no), 4 is selected.

SUM:

The sum() function is used to display the sum. In this table, sum (0), displays the sum,10.

AVG:

The function is used to calculate the average, displays the average. In the above table it displays the average,2.5.

COUNT:

It displays the number of records. It is specified with the asterisk(*) to count the number of records. In the above table displays 4.

No comments:

Post a Comment