Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Tototo1
Starting Member
22 Posts |
Posted - 2012-02-24 : 16:13:35
|
Hello, I am trying to understand what exactly a JOIN does. I get that this will put to tables together, but is there anyway of actually 'seeing' the join and what it is doing. When I try to use these and pull data, my idea of what is happening versus what is actually happening has to be different. Let's say I have a tableXCustomer CustomerID PaymentBill 2222 $400Dave 3333 $500and tableYCustomerTag PurchaseItem 2222 Doll2211 Truck3333 CarIf I do a join on these tables with x.customerid = y.customertag what does this actually 'do'? |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-02-24 : 16:18:12
|
Take a look at this page (and the pages following that which explain different types of joins). It does a very good job of explaining, using an example almost similar to yours:http://www.w3schools.com/sql/sql_join.asp |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-02-25 : 11:33:04
|
quote: Originally posted by Tototo1 Hello, I am trying to understand what exactly a JOIN does. I get that this will put to tables together, but is there anyway of actually 'seeing' the join and what it is doing. When I try to use these and pull data, my idea of what is happening versus what is actually happening has to be different. Let's say I have a tableXCustomer CustomerID PaymentBill 2222 $400Dave 3333 $500and tableYCustomerTag PurchaseItem 2222 Doll2211 Truck3333 CarIf I do a join on these tables with x.customerid = y.customertag what does this actually 'do'?
it will link the two tables based on the condition and then return the data which have exact matchesieCustomer CustomerID Payment PurchaseItem Bill 2222 $400 DollDave 3333 $500 Car ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|