Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2007
    Posts
    20

    Unanswered: Can you join tables like this?

    SELECT
    t1.FieldOn2,
    t2.SomeFieldFromt2,
    t3.SomeFieldFromt3,
    t4.SomeFieldFromt4,
    t5.SomeFieldFromt5
    FROM
    t1
    JOIN t2 on (t2.Company = t1.Company AND t2.t1Seq = t1.t1Seq)
    JOIN t3 on (t3.Company = t2.Company AND t3.JobNum = t2.JobNum AND t3.AssemblySeq = t2.AssemblySeq)
    JOIN t5 on (t5.Company = t2.Company AND t5.JobNum = t2.JobNum AND t5.AssemblySeq = t3.AssemblySeq AND t5.OprSeq = t2.OprSeq)
    JOIN t4 on (t4.Company = t5.Company AND t4.OpCode = t5.Opcode)
    WHERE
    t1.Field = 'Yadda ...''
    My question is about joining in table 5.
    Can you use 2 tables to join in this table? (I'm using t2 and t3 when you look at it)
    Last edited by landrun; 06-17-08 at 10:19.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    .......aaaaaaaaaaaaaannndddd - what happened when you tried it?

  3. #3
    Join Date
    Sep 2005
    Posts
    161
    Yes. You can join on any table(s) that are in previous predicates.
    I assume that this works, but you are not getting the results you desire?

  4. #4
    Join Date
    Feb 2007
    Posts
    20
    Actually, it does work. I just wanted to make sure that even though it worked nothing was going to blow up on me in the future.

    In my mind, you should be able to do this because you're really joining in your existing record set with another table. So you should be able to join the new table on any existing fields in the current record set.

    Thanks for the reply. I can rest at ease now.

  5. #5
    Join Date
    Jun 2005
    Posts
    319
    it will only work 4 times then it will blow up your DB, make sure you have DB insurance.

  6. #6
    Join Date
    Aug 2005
    Posts
    75
    Quote Originally Posted by Gagnon
    it will only work 4 times then it will blow up your DB, make sure you have DB insurance.

    call Microsoft licensing, they'll be glad to help out

Posting Permissions

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