What is a self join? Explain it with an example?
Answer Posted / krishna prasad a
For this Answer 1 is incorrect.
CREATE TABLE candytest
(kidId char(2),
candycolor varchar(10)
)
GO
INSERT INTO candytest SELECT 'K1', 'Yellow'
INSERT INTO candytest SELECT 'K1', 'Red'
INSERT INTO candytest SELECT 'K2', 'Red'
INSERT INTO candytest SELECT 'K2', 'Blue'
INSERT INTO candytest SELECT 'K3', 'White'
INSERT INTO candytest SELECT 'K3', 'Red'
INSERT INTO candytest SELECT 'K3', 'Yellow'
Go
--Now to find those kidid's which has both yellow and red
colored candies, we can write query as:
Select c1.candytest from
candytest c1,candytest c2
where c1.candycolor=c2.candycolor
and c1.kidid=c2.kidid
| Is This Answer Correct ? | 20 Yes | 13 No |
Post New Answer View All Answers
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
Who are naive users?
Explain about the relational database?
Explain about network model?
Explain about query and reporting.
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.
How can you log an error to the server event log from a stored procedure?
explain detail about ftp in datastage?
What you can do to remove data from the cache and query plans from memory for testing the performance of a query repeatedly?
What is the physical representation for a many-to-many relationship?
Write short notes on manual refreshes.
Explain about post-relational databases?
To convert IDMS to DB2, how to deal with IDMS occurs and redefined clause?
What is normalization? Explain different levels of normalization?
There is a trigger defined for INSERT operations on a table, in an OLTP system. The trigger is written to instantiate a COM object and pass the newly insterted rows to it for some custom processing. What do you think of this implementation? Can this be implemented better?