Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • MySQL join across three tables

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 234
    Comment on it

    To implement joins(inner join,outer,full) in three tables you need to execute following MySQL statements:

    select * from 
    table1 as t1
    join table2 as t2 on condition
    join table3 as t3 on condition
    

    Example: Suppose we have a database product having tables product_category(id, category_name), product_info(id,cat_id,name), product_quantity(prod_id, quantity), . We need to display the product details with category name and quantity. To implement this you need to execute the following MySQL statement:

    Select prod.id, prod.name, cat.category_name, quan.quantity
    from product_category as cat
    join product_info as prod on cat.id=prod.cat_id
    join product_quantity as quan on quan.prod_id=prod.id
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: