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 / 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


Please Help Members By Posting Answers For Below Questions

You are testing the performance of a query the first time you run the query, the performance is slow. the second time you run the query, the performance is fast. why is this?

890


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?

2368


What is DB Development software?

1999


What are the constraints on severity level in raiseerror?

932


If a column is an image value type, how you can compare column values? How can you use this column in join clause?

947


Any sample or model question of punjab national bank for deputy manger IT or any sample of PNB.any1 plz do send on

2153


Explain about the storage and physical database design?

865


What are the three types of database design?

959


What is the database development process?

1148


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?

944


To convert IDMS to DB2, how to deal with IDMS occurs and redefined clause?

3945


I have a few records all are same structures data, I want to store data in multiple targets how

2585


State the acid rules?

1067


Explain what a database is?

978


What is database design and development?

953