|
|
-
|
|
Select PLAYERID,Concat(PLAYERFIRSTNAME,Concat(' ' , PLAYERLASTNAME)) PlayerName,Coalesce(FeePerMatch,100) From tblplayers Order By PLAYERID;
PLAYERID PLAYERNAME COALESCE(FEEPERMATCH,100)
---------- --------------------- -------------------------
1 A Raman ......
|
|
-
|
|
Select PLAYERID,Concat(PLAYERFIRSTNAME,Concat(' ' , PLAYERLASTNAME)) PlayerName,FEEPERMATCH,NullIF(FeePerMatch,1000) From tblplayers Order By PLAYERID;
PLAYERID PLAYERNAME FEEPERMATCH NULLIF(FEEPERMATCH,100)
---------- --------------------- ----------- -----------------------
......
|
|
-
|
|
Select PLAYERID,Concat(PLAYERFIRSTNAME,Co......
|
|
-
|
|
Let Us Learn Oracle - Part 12 of N [ NVL function in Oracle ]
Source table: tblPlayers
Purpose: It substitute a value when a null value is encountered.
Syntax: NVL( ColumnName, ReplaceValue )
Where,
ColumnName => It is the column that is use for null value test.
ReplaceValue => Value that w......
|
|
-
|
|
Select PlayerID,BelongsTO,Width_Bucket(Sum(FeePerMatch),100,5000,10) Bucket From tblplayers Group By PlayerID,BelongsTO Order By PlayerID;
PLAYERID BELONGSTO BUCKET
---------- ---------- ----------
1 India 4
2 India 2
3 India ......
|
|
-
|
|
Let Us Learn Oracle - Part 10 of N [ BitAnd function in Oracle ]
Syntax: BitAnd(X,Y)
Purpose: Computes bitwise logical AND operation of 'X' and 'Y' where 'X' and 'Y' are positive integers
Example:
SQL> Select BitAnd(10,2) Result From Dual;
RESULT
----------
2
</pre>
The......
|
|
-
|
|
Let Us Learn Oracle - Part 9 of N [ Decode function in Oracle ]
Source table: tblPlayers
Purpose: It is the value substitution function. It can also be treated as as shorter form of Case statement or Ternary Operator in C#/C/C++/Java etc.
Example:
SQL> Select PlayerLastName,DECODE(PlayerL......
|
|
-
|
|
Let Us Learn Oracle - Part 8 of N [ Translate function in Oracle ]
Source table: tblPlayers
Syntax: Translate(char, from,to)
Purpose: Replaces all characters of 'from' with characters of 'to' at that particular position
Example 1:
SQL> Select PlayerLastName,Translate(PlayerLastName,'ABC......
|
|
-
|
|
Let Us Learn Oracle - Part 7 of N [ CHR function in Oracle ]
Source table: tblPlayers
Purpose: Return the ASCII character of the number specified
SQL> Select CHR(65) From Dual;
C
-
A
</pre>
It does not return the ASCII of any character
SQL> select chr('a') from dual;
select chr......
|
|
-
|
|
Let Us Learn Oracle - Part 6 of N [ RPad and LPad function in Oracle ]
Source table: tblPlayers
RPad
Syntax: RPad(InputString,length,[,set])
Purpose: Pads the right side of the column with the given character. It fills the display to the given length. If InputString is longer than length, s......
|
|