Results 1 to 3 of 3

Thread: INNER JOIN vs WHERE

  1. #1
    Join Date
    May 2012
    Posts
    1

    Question INNER JOIN vs WHERE

    Hi,

    I need to filter out records from a query that select items from 6-7 tables (using union all).
    All these tables has a field of transaction guid.
    I also have a Transactions table with all tran. guids.

    The question is what better to do:
    Use an INER JOIN 6-7 times on each item table
    or
    Add "WHERE itemTransactionGuid in (select trnGuid from Transactions)" on each item table


    The query is part of a report's SP so performance is important.
    Any help will be appriciated.
    Thanks!!

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    I would use JOIN rather than WHERE clause. You can have additional filtering in WHERE clause.

  3. #3
    Join Date
    Jul 2012
    Posts
    2
    The most important is an SQL execution plan, which generates by database engine, so it's more important pay attention on existing and used indexes for a fileds used for table joins.

Posting Permissions

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