+ Reply to Thread
Results 1 to 4 of 4

Thread: Query help

  1. #1
    Registered User
    Join Date
    04-18-2011
    Location
    Bucuresti
    MS-Off Ver
    Excel 2007
    Posts
    64

    Query help

    Hi, i have 2 tables

    Table 1 has info regarding Contracts
    Table 2 has info regarding aditional data for some of the Contracts in table 1

    I need a query that will show me all contracts in table 1 and the aditional info from table 2 tied to the appropriate contract. (the query that i have now with data selected from both tables only shows me the contracts form table 1 which have a link to data in table 2)


    Hope u understand what i'm trying to do.
    Last edited by ciprian; 09-13-2011 at 04:37 AM.

  2. #2
    Registered User
    Join Date
    04-18-2011
    Location
    Bucuresti
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: Query help

    i think i need to use left join instead of inner join

    PS i would have deleted the thread but can't find the button to do that

  3. #3
    Valued Forum Contributor Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds/Sheffield, England
    MS-Off Ver
    Excel 2003
    Posts
    1,030

    Re: Query help

    Hi Ciprian,

    The join you are looking for is a left join, the syntax would be as below:

    SELECT column_name(s)
    FROM table_name1
    LEFT JOIN table_name2
    ON table_name1.column_name=table_name2.column_name
    Have a look here for an explanation

    http://www.w3schools.com/sql/sql_join_left.asp

  4. #4
    Registered User
    Join Date
    04-18-2011
    Location
    Bucuresti
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: Query help

    thanks Kyle, for the quick reply

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0