What is a self join? Explain it with an example?

Answer Posted / vijayan.t

A table join to itself is known as self join.


select e1.empid,e1.empname,e1.empmgrname where empmgrid =
empid;

here in a single table e1 having three fields(employee id,
employee name,manager id)one employee's manager id is
another one employee's employee id so compare that 2 ids and
we can get the particular employee's manager name...

Is This Answer Correct ?    4 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of database model?

536


Can an extended stored procedure be called from inside a user-defined function?

605


The count() function always returns a int value type what should you do if you need to count rows from a query which you know will return a value that is too large for an int value type?

573


Explain about normal forms?

595


How to use timestamp datatypes

1574






Explain the role of indexing in databases?

640


Hi , any one can help me on the same,this is regarding the Informatica Function doc,i want to know how developer is will develop the mapping. pl forwar the any function doc .just for my references. svlc75@yahoo.co.in

1582


Which data type cannot be used as a parameter in a udf?

571


You have a table with three columns: amount1, amount2, and amount3 in a single row only one of these three columns will have a value and the other two will be null. Write a sql query to retrieve the values from these columns?

544


Explain what a database is?

609


What is DB Development software?

1611


fact table and dimension table containg one to many relationship or many to one relastionship

2073


Does QTP Support the Propjects which are running in Dot Net? As we are starting with new project in Dot net need to use automation tool?Please advice & let me know what would be the best.

1599


I HAVE A PI ON COL A THE NEXT DAY I WANT CHANGE THE PI ON COL B? PLS SEND ME THE ANS

2412


Which four data types cannot be used as a return type from a user-defined function?

577