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 |
Explain in brief how does db2 determine what lock-size to use?
in db2, already 10 columns arie der, and i want to insert 11th column. what parameters u wil consider for insertion and how will u insert
What is the difference between drop table and delete table?
How is the value function used?
What is a Database Request Module(DBRM)?
What are db2 error codes -305 and -407. What is the difference between these 2 error codes ?
In SPUFI suppose you want to select maximum of 1000 rows, but the select returns only 200 rows. What are the 2 SQLCODEs that are returned?
How do you stop a db2 database in linux?
What is DCLGEN ?
How to find primary key of a table in db2?
What is db2 look?
A Table feild is declared as Decimal(7,2). I want to insert the decimal in to this column thru cobol-db2 program. How should I declare my local input file variable or any suggestion?