How To Make Subquery In Oracle

Today, I want to talk about to make Subquery in Oracle.  A subquery is a SELECT statement that nested inside another statement such as SELECT, INSERT, UPDATE, or DELETE. You need this operations for showing datas from your database in a mixed format. Now lets start making a subquery in Oracle.

Assume that you have to pull the maximum salaried person from a person table. We can do it with this query.

We will find the highest salary with max (salary) function in the subquery. Than we will get the highest salaried person info  with where condition.

Now lets give another example of subquery in select clause. The following statement returns the person name, salary, and the average salary of persons according to their categories:

 

This will be the last example I will give you on subquerying in Oracle.  The following statement returns the top 10 orders with the highest values.

Thats all for subquerying in Oracle.  If you have interested about MS SqlServer you can have a look at my other post Using Stored Procedures In MSSQL

 

You may also like...

1 Response

  1. May 20, 2019

    […] You can have a look at my other post about How to make subquery in Oracle. […]

Leave a Reply

Your email address will not be published. Required fields are marked *