What is a self join? Explain it with an example?
Answer Posted / sushant more (sybase dba)
CREATE TABLE EMPLOYEE(
[EMPLOYEE_ID] INT PRIMARY KEY,
[NAME] NVARCHAR(50),
[MANAGER_ID] INT
)
GO
INSERT INTO EMPLOYEE VALUES(101,'Mary',102)
INSERT INTO EMPLOYEE VALUES(102,'Ravi',NULL)
INSERT INTO EMPLOYEE VALUES(103,'Raj',102)
INSERT INTO EMPLOYEE VALUES(104,'Pete',103)
INSERT INTO EMPLOYEE VALUES(105,'Prasad',103)
INSERT INTO EMPLOYEE VALUES(106,'Ben',103)
select e1.NAME from EMPLOYEE e1,EMPLOYEE e2
where e1.EMPLOYEE_ID = e2.MANAGER_ID
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are the 18 schemas?
How to use online Backups?
What are the key features of dbms?
Any sample or model question of punjab national bank for deputy manger IT or any sample of PNB.any1 plz do send on
How to customize error conditions.
Explain about the relational database?
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
Explain about the storage and physical database design?
What are the main phases of database development?
How to use timestamp datatypes
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?
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.
Where is dbms used?
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?
1. Using the XML Document below, with the URI “recipe.xml”
define
the following queries in XQuery:
a.) Give the names of all breakfast in the menu.
b.) Select breakfasts that have price lower than $7.00?