What is a self join? Explain it with an example?
Answer Posted / madhavi
Joining the table to itself is self join.
Example:
To find the manager name for each employee in the employee
table:
select e1.empno employee_id,e1.ename employee_name,e2.ename
manager_name,e2.empno employee_num from emp e1,emp e2 where
e1.empno=e2.mgr;
Is This Answer Correct ? | 27 Yes | 17 No |
Post New Answer View All Answers
How can you log an error to the server event log from a stored procedure?
Explain the cube operator?
How to generate OIDS
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?
Write short notes on manual refreshes.
To convert IDMS to DB2, how to deal with IDMS occurs and redefined clause?
I have a few records all are same structures data, I want to store data in multiple targets how
Who are naive users?
Explain about post-relational databases?
Pgm A calls Pgm B and pgm B uses cursor, when pgm B is called second time, the program is abending saying the cursor is opened? Why?
How to replace not in with not exist?
Explain about normal forms?
What are the types of database model?
What are the constraints on severity level in raiseerror?
How is data stored in dbms?