SQL Functions
SQL Functions
STRING FUNCTION
Some of the commonly used mathematical functions are
sum() avg(), count(), min(), max() etc.
ADD_MONTHS(D,N):
SELECT ADD_MONTHS(first date, 2) FROM dual;
This function adds number of months to a given date and
returns a date after those many months.
Syntax: ROUND(SYSDATE,’MONTH’)
SELECT TRUNC(‘03-05-2011’, ’05’) FROM DUAL;
Output : 01-05-2011 -> Nearest date of the same month.
DELETE Command
To delete the record fro a table SQL provides a
delete statement.
General syntax is:-
That is first all the rows of the table have to be deleted and
only then the table can be dropped.