innerjoin between 3 table columns

  • Hai,

    i want to know innerjoin between 3 tables ata a time.

    plz helpme.

  • Could you give us a little more information? Table names, column names? Do you mean joining 3 tables or using 3 columns to join 2 tables?

    Here's an example of a 3 table join:

    [font="Courier New"]/* tables

    Orders(OrderID Primary Key, CustomerID, OrderDate)

    OrderDetails(OrderDetailID Primary Key, OrderID, ProductId, OrderQty)

    Products(ProductID Primary Key, ProductName, ProductDescription)

    */

    SELECT

       O.OrderDate,

       D.OrderQty,

       P.ProductName

    FROM

       dbo.Orders O INNER JOIN

       dbo.OrderDetails D ON

           O.OrderID = D.OrderID INNER JOIN

       dbo.Products P ON

           D.ProductID = P.ProductID[/font]

  • Thank you,

    joining different columns in 3 tables using innerjoin.

    once again thankyou.

  • anithareddyg1 (8/25/2008)


    Thank you,

    joining different columns in 3 tables using innerjoin.

    once again thankyou.

    Jack just gave you an example for a three-table join - is that what you need? There are no specifics, no issue described, not even a question asked. What do you need to know? What do the tables look like?

    In other words - help us help you by asking the question(s) you have about this setup.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • Actually im getting the answer for ur first reply.

    because im not give u full description about that.

    sorry for inconvinence

    thank you

  • Thank you very much......... Really this article, helps me alot.

  • Jack Corbat you are great....... you solve on of my very big problem....

  • thank you

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply