SQL-OracleFunctions-Page19

                                                                                             


πŸ‘‰Oracle Functions

✅Select AVG(CURBAL) "Average Balance"  from  ACCT_MSTR

✅Select MIN(CURBAL) "Minimum Balance" from  ACCT_MSTR

✅COUNT(expr)
Returns the number of rows where expr is not null.
Select COUNT(ACCT_NO) "No. of Accounts" from ACCT_MSTR

✅COUNT(*)
Returns the number of rows in the table, including duplicates and those with nulls.
Select COUNT(*) "No. of Records" from ACCT_MSTR

✅Max
Returns the maximum value of expression.
Select Max(CURBAL) "Maximum Balance" from ACCT_MSTR

✅Sum
Returns the sum of values.
Select Sum(CURBAL) "Total Balance" from ACCT_MSTR

✅Coalesce
Below query returns FNAME as CustomerName if FNAME is not null, in case FNAME is null, it returns CUST_NO as CustomerName, i.e. it returns the first not null value from the expression.

Select Coalesce(FNAME, CUST_NO) CustomerName from CUST_MSTR

Comments

Popular posts from this blog

SQL-ForeignKeyConstraint-Page6

Javascript-OOPs(Part3)-Inheritance - (9)

OraclePLSQL-Page3