What technique is used to retrieve data from more than one
table in a single SQL statement?
Answers were Sorted based on User's Feedback
Answer / mani
Both UNION or UNION ALL and JOIN can be used.
The purpose of retreiving data from more than one table in a
single statement generally happens when the ouput of the
involved tables has same table structure and in this case
either UNION (to eliminate the duplicates in the resultant
table)or UNION ALL (to retain the duplicates in the
resultant table)could be used.
If retrieval is based on seletion criterion then JOINS could
also be used but here the resultant table structure can be
different from that of the tables involved in join operation.
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / ravi
We can do this by using JOINS as well as Sub Queries
Is This Answer Correct ? | 4 Yes | 2 No |
Answer / rahul
select <column name of 1st table>,<column name of 2nd table>
from <Table name 1st>,<Table name2nd>;
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / anjireddy vintha
By using JOINS and UNIONS we can retive data from
morethan one table.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / karthik
select <column name of 1st table>,<column name of 2nd table>
from <Table name 1st> join <Table name2nd> where
table1.columnname = table2.columnname;
atleast one column should be unique in both the tables.
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / ajay rana
join techniques is used to to retrieve data from more than
one table in a single SQL statement.
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / biryuk
UNION could be used to retrieve data from more than one
table as well.
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / bala
Using Temp Table data can be retrieved from more than one
table.
Is This Answer Correct ? | 0 Yes | 3 No |
What is EXPLAIN?
How can you quickly find out the number of rows updated after an update statement?
db2 query I have one table with the following details. SNO SNAME DOJ ------ -------------------- ---------- 10 KRISH 2007-03-19 20 REDDY 2007-05-19 30 RRRRR 2007-05-19 40 BBBBB 2008-05-19 50 CCCCC 2009-05-19 60 JJJJJ 2009-05-19 70 JJJJJ 2004-05-19 i want the output in the following format:( no of students joined in each year(no nedd to consider about month and date) year count --------- ---------- 2004 1 2007 3 2008 1 2009 2
how do you resolve -818 error in db2. where we have to see time stamp token. i said by seeing in load module and plan .is it correct or not. give clear explination for how to see time stamp token
One program calling 5 subprograms, its a cobol db2 program, after precompilation how many plans and packages will created?
Define buffer pool.
What is the SQL query to select, delete and get count of duplicate rows in DB2?
What is plan in cobol db2?
How can you display the current date & current time ?
Explain in brief how does db2 determine what lock-size to use?
OUTER JOINS USED TO GET MATCHING AND NONMATCHING ROWS FORM 2 OR MORE TABLES BASED ON COLUMNS. SIMPLE JOINS ALSO DO THE SAME THEN WHAT IS THE USE OF OUTER JOINS.
Which component is used to execute the sql statements?