What is a self join ?

Answer Posted / rupesh.dbms@gmail.com

It is the join in which result is obtained by equating two
coloumns with same values of one table for example
emp(eno,ename,mgrno) eno is primary key and mgrno is
recursive foreign key

select e.eno,e.ename,m.mgrno,m.ename mgrname
from emp e, emp m
where m.eno=e.mgrno;
note : one table emp is replicated as m , e and then
result is obtained.

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pl sql collection?

519


How many indexes can be created on a table in sql?

494


How to write a query to show the details of a student from students table whose

538


Why we use stored procedure instead of query?

528


Write the command to remove all players named sachin from the players table.

729






How is data stored in sql?

546


What are sql built in functions?

506


Are sql database names case sensitive?

495


What is varchar example?

569


What is trigger in pl sql with examples?

519


How do you concatenate in sql?

547


What is the usage of when clause in trigger?

563


how would you write a query to select all teams that won either 2, 4, 6 or 8 games? : Sql dba

766


What is the source code of a program?

503


what is sql server agent? : Sql dba

599