General Functions in SQL

What are the general functions available in SQL?

Questions by sprajarajan   answers by sprajarajan

Showing Answers 1 - 2 of 2 Answers

Aggregate Functions:
AVG() - Returns the average value 
COUNT() - Returns the number of rows
FIRST() - Returns the first value
LAST() - Returns the last value
MAX() - Returns the largest value
MIN() - Returns the smallest value
SUM() - Returns the sum

Scalar Functions
UCASE() - Converts a field to upper case

LCASE() - Converts a field to lower case
MID() - Extract characters from a text field
LEN() - Returns the length of a text field
ROUND() - Rounds a numeric field to the number of decimals specified
NOW() - Returns the current system date and time
FORMAT() - Formats how a field is to be displayed


  Was this answer useful?  Yes

aghiad

  • Sep 10th, 2011
 

The General function are use in SQL
1-NVL (exp1,exp2)
2-NVL2 (exp1,exp2,exp3)
3-NULLIF (exp1,exp2)
4-COALESCE (exp1,exp2,exp3,......,expn)
For example:

Code
  1.  

As you see in example above, we use NVL (dont forget that NVL takes in 2 arguments) so we put in it commission_pct,0.10
NOTE : Comm is the alias of the code NVL(commission,0.10)
Example 2 :
Code
  1.  

Example 3 :
Code
  1. span style="color: #ff0000;">"expr1""expr2"

Example 4 :
Code
  1.  

I hope you got the point ^_^

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions