Pages

Showing posts with label ORACLE. Show all posts
Showing posts with label ORACLE. Show all posts

4 September 2016

ORACLE - How to copy column names or header from query result set in ORACLE SQL DEVELOPER ?

When we are working on ORACLE SQL DEVELOPER, we come across many situations where we need to copy only column names of a table or column names along with all data from query result set to excel or notepad. This can be done by the following ways:

COPY ONLY COLUMN NAMES:

When you want to copy only column names from result query, select cells corresponding to the columns which you want to copy. Right click on the column name and select option "Copy Selected Column Header(s)". This way column names get copied in clipboard which you can paste wherever you want. See below screenshot .

ORACLE - How to copy column names or header from query result set in ORACLE SQL DEVELOPER ?



COPY COLUMN NAMES ALONG WITH DATA:

14 August 2016

SQL - ADVANCED JOINS

In my earlier SQL- JOINS  post , I had discussed about INNER JOIN , LEFT OUTER JOIN, RIGHT OUTER JOIN, SELF JOIN and CROSS JOIN. In this post, I am going to discuss about ADVANCED JOINS. Please visit my earlier post on JOINS in below URL if you have not visited.

                               We have seen that LEFT OUTER JOIN includes matching rows between left table and right table and non matching rows from left table. This is illustrated with table and venn diagram as below:


                                                                                               
Select Name,Productname,Quantity,
       P.Productid,Mrp
From Customerinfo C
LEFT Outer Join Productinfo P
On C.Productid=P.Productid;



11 August 2016

ORACLE- Guide to install Oracle 11g in your local machine



Step 1:  Visit  to https://www.oracle.com/index.html  and make Oracle account.

Step 2: Login to Oracle account and then navigate to Download Section as below:



6 August 2016

ORACLE- ANALYTIC FUNCTIONS LEAD and LAG

ORACLE- ANALYTIC FUNCTIONS LEAD and LAG

LEAD : It is a analytic function which fetches value of a column from next row. If the value in next row goes out of table or partition, default NULL value is populated. The best part of this function is that it gives access to more than one row in a table without using SELF JOIN.


SYNTAX:

7 September 2014

ORACLE : ROWNUM and ROWID


ROWID is the physical location or address of row.It is permanent. It is the fastest means of accessing data.

ROWNUM is the sequential number which is assigned to each row during query execution. It basically represents the sequential order in which the rows are fetched. It is temporary.

Lets see below the illustration of ROWNUM and ROWID .

ROWNUM and ROWID