Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Answer Posted / sanchit aggarwal(oracle dev.)

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 ?    31 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi my program is accesing data from two db2 databases.what is the bind card for this program to genarate plan? how to specify the two owners and two qualifiers in bind card

2118


How long can an error message be in raiseerror function?

959


Where is dbms used?

1021


State the acid rules?

1078


Explain about post-relational databases?

963


Explain about the database management systems.

927


How to replace not in with not exist?

2004


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?

2381


What are the key features of dbms?

951


How to read and create .LDC data files which are used by linguatic dictionary.

2486


Explain the process of the user request and data generating?

1049


What is database design and development?

964


Explain about the relational database?

1009


In which table collections errors are stored.

2351


What is DB Development software?

2016