Results 1 to 4 of 4

Thread: sql problem

  1. #1
    Join Date
    Jul 2003
    Posts
    1

    sql problem

    Hi,
    I want to know what is the different between these querys
    SELECT *
    FROM table1, table 2
    WHERE ...
    and
    SELECT *
    FROM (table1, table2)
    WHERE ...

    When i try to execute the last query, i have an oracle error like that
    ORC-00928: Missing SELECT keyword

    Thanks

  2. #2
    Join Date
    Mar 2003
    Posts
    468
    i would assume that oracle is complaining about the '(' & ')' in the from clause. typically the '(' in a from clause is signaling to oracle that there is going to be a select that follows such as :

    select *
    from (select * from table1),
    (select * from table2)
    where ...

  3. #3
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Second SELECT is not syntactically correct.

    If you are using 9i then you can use ANSI join syntax in FROM clause like

    select *
    from table1 join table2

  4. #4
    Join Date
    Aug 2003
    Posts
    4
    well normally a '(' after a FROM indicates a following Sub-query hence the error in the 2nd query.

    Using a join is better but tedius.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •