0% found this document useful (0 votes)
8 views1 page

SQL D3

Uploaded by

r2701575
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

SQL D3

Uploaded by

r2701575
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

Character Manipulation Function

-------------------------------
1.Length
2.Reverse
3.Replace
4.translate
5.Concat - Help to combine the two different column or string
6.Pipeline ||
7.instr
8.substr
9.Ltrim
10.Rtrim
11.Lpad
12.Rpad

===================================================================================
==================

General Function
----------------
1.Decode
2.Case

===================================================================================
===================

Analytical Function (Window Function)


-------------------------------------
1.Rank - 10 10 10 5 3 - 1 1 1 4 5
2.Dense_Rank - 10 10 8 5 3 - 1 1 2 3 4
3.Lead
4.Lag
5.row_number

select first_name,salary,rank() over(order by salary desc) from employees

select * from (select first_name,salary,rank() over(order by salary desc) as rank


from employees)
where rank=3

Department wise top salary


--------------------------
select * from (select department_id,salary,dense_rank()over(partition by
department_id order by salary desc)as rank from employees)

Row_Number
----------
select first_name ,row_number () over(order by first_name ) from employees

Lead and Lag


------------
select first_name,lead(first_name) over(order by first_name) from employees

select first_name,lag(first_name) over(order by first_name) from employees

You might also like