What is the result ofselect * from table1, table2there is a common column between them but no where caluse has been specified

Showing Answers 1 - 11 of 11 Answers

aditi

  • Jun 12th, 2006
 

i tried to run the query & got the same result as on performing natural join on the tables.

  Was this answer useful?  Yes

Bharat

  • Jun 12th, 2006
 

The result will be the cartesian product of the rows

  Was this answer useful?  Yes

MANS1201

  • Jun 13th, 2006
 

THE RESULT OF SELECT * FROM TABLE1, TABLE2 ISGIVE THE ROWS AND COLUMN OF THE TABLE1 AND TABLE 2 WITH THE CARTISION PRODUCT OF THE TABLES

  Was this answer useful?  Yes

Arnab Sengupta

  • Jun 16th, 2006
 

Hi Aditi,The tables probably contained one row each. With no where clause specified you would hit a cartesian join.Regards.Arnab.

  Was this answer useful?  Yes

abc

  • Jun 19th, 2006
 

Any queries that you run without a where clause would create a cartesian join, which has meaningless output.

  Was this answer useful?  Yes

msuri

  • Jul 24th, 2006
 

Though the they haveing common cloumn without mention where or Natural join its  will be cartesian product

  Was this answer useful?  Yes

assume that 2 table are emp,dept

now write query like this

select * from emp,dept

the out put is emp has 14 records and dept has 4 records

then output is 14x4=56 records you will simply.

  Was this answer useful?  Yes

Assume you have following two tables:

SQL> select * from aa;
DAT   NAME
----   --------

1       Amit
2       Jas

SQL> select * from bb;
DAT   ANAME
----   ---------

1       Delhi
3       Mumbai

The following SQL will give me 4 rows
SQL> select * from aa, bb;
DAT NAME  DAT_1   ANAME
---- -------  -------  --------- 

1     Amit      1            Delhi
2     Jas       1            Delhi
1     Amit     3            Mumbai
2     Jas       3           Mumbai


Now if any of the 2 table having 0 rows then the result will : No rows selected. As 

in Oracle, any addition, multiplication, division and joining two tables with one as null the output will only be as Null.

To have natural join we need to do following:

SQL> select * from aa natural join bb;
DAT   NAME     ANAME
---  ------   -------
1     Amit       Delhi


I hope this will help.


  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions