can any one explain me what result will this query return and why?

  • select * from table1,table2 where table1.b=+table2.x

    i have two tables table1 and table2. table1 has two columns a and b and table2 has x and y.

     

    thanks in advance

  • I assume the "+" is a typo?  Your query will return all rows from table1 and table2 where the value of the column b in table1 matches the value of column x in table2.  It can (should, really) be written in ANSI compliant syntax like this:

    SELECT * FROM table1 m

    INNER JOIN table2 n

    ON m.b = n.x

    Is this a homework question?

    John

  • The (+) is outer join mostly using in Oracle.  It is not ANSI standard.

    SELECT * FROM table1, table2 where table1.b = table2.x (+)

    It means if x in table2 can't find a match in table1, it would still appear in the output.

     

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply