Joing 2 table multiple times

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Joing 2 table multiple times

    Any Advise is greatly appreciated!!!

    Access Database tables:
    ? Admins
    1. id (PK)
    2. name
    ? Book_05
    1. id(PK)
    2. mem_id
    3. book_date
    4. booked_by
    5. call_by
    6. confirmed_by
    ? Members
    1. id(PK)
    2. fnname
    3. lname

    My Query:

    select b.*, m.fname, m.lname, a.name
    from book_05 b, members m, admins a
    where b.mem_id = m.id
    and b.admin = a.id
    order by lname


    Problem:

    The Admins table is joined 4 times to the Book_05 table.
    ? Admins.id = book_04.mem_id
    ? Admins.id = book_04.book_by
    ? Admins.id = book_04.call_by
    ? Admins.id = book_04.confirmed_by

    For each record in the book_05 there can be 4 different admins.id. I?m having
    problem display the admins.name in the output. I need to some how join the
    table 4 time or something.

    Want:

    To display admin name if there were 4 different admin that update each item
    then the output should show accordingly. I hope this is clear, thank you for
    you help.
    :beer;

    phamtum Guest

  2. Similar Questions and Discussions

    1. same video multiple times
      does anybody know how to make the same video show up nine times across the page(same size) and possibly make a button to to have all of the same ...
    2. CFExecute Multiple Times Not Working?
      I am also executing a particular EXE more than once. Will using CFLOCK exclusive prevent more than one copy of the program from executing if the...
    3. Still cannot undo multiple times?
      What is going on down there at Macromedia HQ? How difficult is it to add a multiple undo feature to Director? I understand there is a lot going...
    4. problem matching multiple times
      Hi All, I have a content management system that I'm building and I'm having issues matching a variable that needs to be replaced with rows from a...
    5. COM dll being called multiple times
      > This issue I am seeing is the same information being How are you using the DLL from the asp code?
  3. #2

    Default Re: Joing 2 table multiple times

    You will need to JOIN with the [Admins] table multiple times. Once for each
    admin ID column.


    ....
    ? Admins.id = book_04.mem_id


    But first, is this a typo, or is the Admins.id value a member ID (i.e.
    Members.ID)?

    mxstu Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139