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 |
Crima
Starting Member
17 Posts |
Posted - 2012-10-18 : 16:09:46
|
I've been trying to figure out this problemWrite a SELECT statement that returns all columns from the Vendors table inner-joined with theInvoices table.so far i've gotten SELECT * FROM Vendors INNER JOIN Invoices ON Vendor.VendorID = Invoice.VendorIDbut it's not liking Vendor.VendorID = Invoice.VendorIDI don't know another way since this is the only way they're related.Any help helps!A witty student |
|
mandm
Posting Yak Master
120 Posts |
Posted - 2012-10-18 : 16:19:53
|
If your table names are Vendors and Invoices then your table references need to match in the ON condition. i.e. Invoices.VendorID = Vendors.VendorID |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-10-18 : 16:20:20
|
what do you mean its not liking Vendor.VendorID = Invoice.VendorID?can you elaborate with some sample data?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
Crima
Starting Member
17 Posts |
Posted - 2012-10-18 : 17:01:29
|
I just figured it out. Supposed to be "Vendors" instead of Vendor, same with Invoices-________________- Always a little mistake that drives me nutts.A witty student |
 |
|
|
|
|