Results 1 to 3 of 3

Thread: Join Predicate

  1. #1
    Join Date
    Jan 2012
    Posts
    82

    Unanswered: Join Predicate

    Hi,
    I have a question


    We can join two tables using 2 syntaxes.

    FROM
    table1,
    table2

    where

    table1.id=table2.id

    and 2nd is

    table1 inner join table2

    on table1.id=table2.id

    Any idea which is better in performance in terms of query plan and db2 optimizer??

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    old and new syntax = the same operation
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Quote Originally Posted by przytula_guy View Post
    old and new syntax = the same operation
    That's right. I like the 2nd (JOIN..ON.. ) syntax for readability of your SQL. The WHERE clause only contains your selection criteria, the various ON clauses describe how you glue the various tables together.

    N.B. when you code a MQT db2 forces you to code in the "comma" format
    Somewhere between " too small" and " too large" lies the size that is just right.
    - Scott Hayes

Posting Permissions

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