Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

innerjoin between 3 table columns Expand / Collapse
Author
Message
Posted Monday, August 25, 2008 12:42 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, August 25, 2008 1:24 PM
Points: 10, Visits: 19
Hai,


i want to know innerjoin between 3 tables ata a time.
plz helpme.
Post #558355
Posted Monday, August 25, 2008 12:57 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 9:56 AM
Points: 10,380, Visits: 13,434
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:

/* 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






Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #558376
Posted Monday, August 25, 2008 1:10 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, August 25, 2008 1:24 PM
Points: 10, Visits: 19
Thank you,

joining different columns in 3 tables using innerjoin.

once again thankyou.
Post #558389
Posted Monday, August 25, 2008 1:16 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:43 PM
Points: 7,179, Visits: 15,765
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?
Post #558392
Posted Monday, August 25, 2008 1:24 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, August 25, 2008 1:24 PM
Points: 10, Visits: 19

Actually im getting the answer for ur first reply.
because im not give u full description about that.
sorry for inconvinence

thank you

Post #558400
Posted Thursday, May 23, 2013 12:25 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 23, 2013 12:23 PM
Points: 2, Visits: 1
Thank you very much......... Really this article, helps me alot.
Post #1456157
Posted Thursday, May 23, 2013 12:27 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, May 23, 2013 12:23 PM
Points: 2, Visits: 1
Jack Corbat you are great....... you solve on of my very big problem....
Post #1456161
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse