Loading ...
Sorry, an error occurred while loading the content.

Join Tables

Expand Messages
  • Sue Hoffman
    I have a table name tech_id contains field CORP,Contractor. There is another table name LastValidTech contains four fields, Account1, Account2, Account3,
    Message 1 of 3 , Sep 12, 2006
    • 0 Attachment
      I have a table name tech_id contains field CORP,Contractor. There is another table name LastValidTech contains four fields, Account1, Account2, Account3, Account4. Table structure is first 4 digits of LastValidTech (Account1,Account2,Account3,Account4) is CORP.
      tech_id
      CORP,CONTRACTOR
      1211,ABC
      1222,EFG
      1333,KKL
      LastValidTech
      TicketNo, Account1, Account2, Account3, Account4
      1122,01211-12345-01
      1123, ,01222-32456-93
      1124, 01333-73737-04
      Some times the Account1 has a value, Some times Account2 in another record has a value and same some times Account3 and Account4 has a value. How to i join both tables in a sense that if Account1 has a value and match with first 4 digits of CORP then it will connect to CORP or if Account2 has a value and match with first 4 digit with CORP it will connect to CORP or if Account3 and Account4 has a value and match with first 4 digit with CORP then it will connect to CORP.
      Thanks.


      ---------------------------------
      Stay in the know. Pulse on the new Yahoo.com. Check it out.

      [Non-text portions of this message have been removed]
    • Arnie Rowland
      It would help us better assist you if you could include table DDL, query strategy used so far, sample data in the form of INSERT statements, and an
      Message 2 of 3 , Sep 12, 2006
      • 0 Attachment
        It would help us better assist you if you could include table DDL, query
        strategy used so far, sample data in the form of INSERT statements, and an
        illustration of the desired results. (For help with that refer to:
        http://www.aspfaq.com/5006 )

        The less 'set up' work we have to do, the more likely you are going to have
        folks tackle your problem and help you. Without this effort from you, we are
        just playing guessing games.

        - Arnie Rowland

        "I am a great believer in luck, and I find that the harder I work, the more
        I have of it." - Thomas Jefferson (1743-1826)


        -----Original Message-----
        From: SQLQueriesNoCode@yahoogroups.com
        [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Sue Hoffman
        Sent: Tuesday, September 12, 2006 5:58 AM
        To: Arnie
        Subject: [SQLQueriesNoCode] Join Tables

        I have a table name tech_id contains field CORP,Contractor. There is another
        table name LastValidTech contains four fields, Account1, Account2, Account3,
        Account4. Table structure is first 4 digits of LastValidTech
        (Account1,Account2,Account3,Account4) is CORP.
        tech_id
        CORP,CONTRACTOR
        1211,ABC
        1222,EFG
        1333,KKL
        LastValidTech
        TicketNo, Account1, Account2, Account3, Account4
        1122,01211-12345-01
        1123, ,01222-32456-93
        1124, 01333-73737-04
        Some times the Account1 has a value, Some times Account2 in another record
        has a value and same some times Account3 and Account4 has a value. How to i
        join both tables in a sense that if Account1 has a value and match with
        first 4 digits of CORP then it will connect to CORP or if Account2 has a
        value and match with first 4 digit with CORP it will connect to CORP or if
        Account3 and Account4 has a value and match with first 4 digit with CORP
        then it will connect to CORP.
        Thanks.


        ---------------------------------
        Stay in the know. Pulse on the new Yahoo.com. Check it out.

        [Non-text portions of this message have been removed]




        Yahoo! Groups Links














        Disclaimer - September 12, 2006
        This email and any files transmitted with it are confidential and intended solely for SQLQueriesNoCode@yahoogroups.com. If you are not the named addressee you should not disseminate, distribute, copy or alter this email. Any views or opinions presented in this email are solely those of the author and might not represent those of Westwood Consulting, Inc. Warning: Although Westwood Consulting, Inc has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.
        This disclaimer was added by Policy Patrol: http://www.policypatrol.com/


        [Non-text portions of this message have been removed]
      • John Warner
        Give up, been begging her for this for a couple of weeks so far nothing but more requests for more and more DML. John Warner
        Message 3 of 3 , Sep 12, 2006
        • 0 Attachment
          Give up, been begging her for this for a couple of weeks so far nothing
          but more requests for more and more DML.

          John Warner


          > -----Original Message-----
          > From: SQLQueriesNoCode@yahoogroups.com
          > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Arnie Rowland
          > Sent: Tuesday, September 12, 2006 11:07 AM
          > To: SQLQueriesNoCode@yahoogroups.com
          > Subject: RE: [SQLQueriesNoCode] Join Tables
          >
          >
          > It would help us better assist you if you could include table
          > DDL, query strategy used so far, sample data in the form of
          > INSERT statements, and an illustration of the desired
          > results. (For help with that refer to: http://www.aspfaq.com/5006 )
          >
          > The less 'set up' work we have to do, the more likely you are
          > going to have folks tackle your problem and help you. Without
          > this effort from you, we are just playing guessing games.
          >
          > - Arnie Rowland
          >
          > "I am a great believer in luck, and I find that the harder I
          > work, the more I have of it." - Thomas Jefferson (1743-1826)
          >
          >
          > -----Original Message-----
          > From: SQLQueriesNoCode@yahoogroups.com
          > [mailto:SQLQueriesNoCode@yahoogroups.com] On Behalf Of Sue Hoffman
          > Sent: Tuesday, September 12, 2006 5:58 AM
          > To: Arnie
          > Subject: [SQLQueriesNoCode] Join Tables
          >
          > I have a table name tech_id contains field CORP,Contractor.
          > There is another table name LastValidTech contains four
          > fields, Account1, Account2, Account3, Account4. Table
          > structure is first 4 digits of LastValidTech
          > (Account1,Account2,Account3,Account4) is CORP.
          > tech_id
          > CORP,CONTRACTOR
          > 1211,ABC
          > 1222,EFG
          > 1333,KKL
          > LastValidTech
          > TicketNo, Account1, Account2, Account3, Account4 1122,01211-12345-01
          > 1123, ,01222-32456-93
          > 1124, 01333-73737-04
          > Some times the Account1 has a value, Some times Account2 in
          > another record has a value and same some times Account3 and
          > Account4 has a value. How to i join both tables in a sense
          > that if Account1 has a value and match with first 4 digits of
          > CORP then it will connect to CORP or if Account2 has a value
          > and match with first 4 digit with CORP it will connect to
          > CORP or if Account3 and Account4 has a value and match with
          > first 4 digit with CORP then it will connect to CORP.
          > Thanks.
        Your message has been successfully submitted and would be delivered to recipients shortly.