Results 1 to 5 of 5

Thread: ansi sql

  1. #1
    Join Date
    Nov 2008

    Unanswered: ansi sql


    which style is better ansi sql or old sql in oracle? .
    i mean performance wise and maintainability.

    old style
    SELECT *
    FROM Customers c, Orders o, [Order Details] od, Products p
    WHERE o.CustomerID = c.CustomerID
    AND o.OrderID = od.OrderID
    AND od.ProductID = p.ProductID

    ansi stlye
    SELECT *
    FROM Orders o
    INNER JOIN Customers c ON o.CustomerID = c.CustomerID
    INNER JOIN [Order Details] od ON o.OrderID = od.OrderID
    INNER JOIN Products p ON od.ProductID = p.ProductID

  2. #2
    Join Date
    Nov 2003
    Provided Answers: 23
    Quote Originally Posted by VAIBHAV174U
    i mean performance wise
    No difference at all.
    Quote Originally Posted by VAIBHAV174U
    and maintainability.
    The ANSI Style (but I guess that is also a matter of personal taste and experience)

  3. #3
    Join Date
    Sep 2002
    Provided Answers: 1
    They should perform the same. I have known exceptional cases where (presumably due to a bug, and in 9i) the newer ANSI syntax performs worse. However, since the ANSI syntax is so much easier to read my preference is to always write in ANSI syntax, and if there are performance problems with a particular query then consider re-writing in the old format.

  4. #4
    Join Date
    Apr 2002
    Toronto, Canada
    Quote Originally Posted by andrewst
    However, since the ANSI syntax is so much easier to read
    especially for outer joins as compared with oracle's wacko plus sign syntax (if you're not intimately familiar with it) | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jun 2004
    Liverpool, NY USA
    Since I have been writing code since oracle 5, I still use the old (+) syntax. However there are some things like full outer joins that can only be done in the new syntax without using unions.
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

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