Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2013
    Posts
    7

    Select 2 coulmns from same table

    I have 2 tables Job and Sor_item that are linked by a 3rd table Job_item
    simple code gives:
    job_number sor_item_code
    16000045 14CW1400
    16000045 14CW2240
    16000045 14CW2340
    16000161 14CW1400
    16000161 14CW2240
    16000161 14CW2340

    I would like output like
    job_number sor_item_code SOR_ITEM_CODE2
    16000045 14CW2240 14CW2340
    16000161 14CW2240 14CW2340

    ie find which jobs have two sor_item_codes against them, limited to a list (IN ('xxx', 'yyy') and show the soritems in seperate columns

    I think I need something like :
    SELECT1
    FROM1
    (SELECT2
    (SELECT3
    FROM3
    WHERE3) as SOR1
    (SELECT4
    FROM4
    WHERE4) as SOR2
    FROM2
    JOIN OF SOME KIND
    JOIN OF SOME KIND
    WHERE2
    WHERE1
    I have tried all kinds for quite a while but am stuck.
    please can you help?
    Thanks
    Nagog

  2. #2
    Join Date
    Feb 2013
    Posts
    7
    Any help appreciated. new user with my first thread. Thanks

  3. #3
    Join Date
    Feb 2013
    Posts
    7
    Please can someone help me/tell me if I have posted this in the correct place. Thanks

Posting Permissions

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