Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default joining 3 tables?

    helooo...

    i have 3 tables -Recipes, Ingredients and Products.

    Recipes table:
    RecipeID -PK

    Ingredients table:
    IngredientID -PK
    IngreRecipeID -Foreign key to Recipes table
    IngreProductID -Foreign key to Products table

    Table:
    ProductID -PK

    how do i join them into 1 recordset?


    siti_nana Guest

  2. Similar Questions and Discussions

    1. Joining three tables
      Hello all, I am having a bear of a time trying to join three tables in Sybase. Here is the query...... select DISTINCT(appl.ag_id),...
    2. Joining tables, Please help
      <b><u>Objective: </b></u> Join two DB tables to output two queries on a webpage. <b><u>Problem:</b></u> Error Diagnostic Information ODBC Error...
    3. Joining Multiple Tables
      I have a query that enables me to join various tables together. I managed to get all the data I need from all of the tables, aside from one, apart...
    4. joining 3 tables in dataset
      hi my problem is that i have to load 3 different tables from different databases into one dataset and do a join on all. i loaded all tables into...
    5. Joining Tables Across Databases
      This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ...
  3. #2

    Default Re: joining 3 tables?

    siti_nana

    Try theSQL below:

    SELECT *
    FROM Recipes, Ingredients, Products
    WHERE RecipeID = IngreRecipeID AND IngreProductID = ProductID


    "siti_nana" <webforumsuser@macromedia.com> wrote in message
    news:cvnejo$lk2$1@forums.macromedia.com...
    > helooo...
    >
    > i have 3 tables -Recipes, Ingredients and Products.
    >
    > Recipes table:
    > RecipeID -PK
    >
    > Ingredients table:
    > IngredientID -PK
    > IngreRecipeID -Foreign key to Recipes table
    > IngreProductID -Foreign key to Products table
    >
    > Table:
    > ProductID -PK
    >
    > how do i join them into 1 recordset?
    >
    >

    Singularity.co.uk Guest

  4. #3

    Default Re: joining 3 tables?

    select rec.*,ing.*,prod.* from recipe rec
    join ingredient ing
    on rec.recipeid=ing.recipeid
    join product prod
    on ing.productid=prod.productid
    where

    above sql will etract all fields from ur column u can have more specific
    column by replacing the .* to ur column name

    samkry 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